2017-02-02 3 views
0

私は、tfsビルドサーバーにasp.netコアサイトを展開し、iisを実行している.netフレームワークasp.net web apiサイトのアプリケーションを配備しようとしています。tfsからサイトアプリケーションにIISにWebデプロイ

同じアプリケーションフォルダを共有する独自のWebサイトとしてasp.netコアアプリケーションを作成すると、動作させることができます。

私は、Webデプロイメントを使用するときにVisual Studioが生成するpowershellスクリプトを呼び出しています。

それが生成する呼び出しは、受信したエラーが

サイトが見つからないか、ユーザー名/パスワードが間違ってされるか

Error Code: ERROR_USER_UNAUTHORIZEDMore Information: Connected to the remote computer ("server") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.Error : The remote server returned an error: (401) Unauthorized.Error count: 1.

ある

> "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" 
> -source:manifest='C:\Users\BuildService\AppData\Local\Temp\PublishTemp\obj\a\SourceManifest.xml' 
> -dest:manifest='C:\Users\BuildService\AppData\Local\Temp\PublishTemp\obj\a\DestinationManifest.xml',ComputerName='https://server:8172/msdeploy.axd?site=Demo%20mainSite/dotnetCoreApp',UserName='username',Password='{{PASSWORD-REMOVED-FROM-LOG}}',IncludeAcls='False',AuthType='Basic' 
> -verb:sync -enableRule:DoNotDeleteRule -retryAttempts:20 -disablerule:BackupRule -allowUntrusted 

です。スクリプトをサイトに変更するときにスクリプトを言いましたので、サイトのアプリケーションにはサイトに必要な特別な権限がない限り、そうであってはなりません。

ビルド定義

The build definition

引数文字列

-packOutput "$(build.artifactstagingdirectory)" -publishProperties @{'WebPublishMethod'='MSDeploy';  'MSDeployServiceURL'='$(remoteUrl)'; 'DeployIisAppPath'='$(appName)';'UserName'='$(ausername)';'Password'="$(password)"; 'EnvironmentName'='$(environment)'; 'EnableMSDeployBackup'='$(backup)';'AllowUntrustedCertificate'='true'} -Verbose 

変数 build variables

完全なログ

2017-02-02T15:06:25.0517357Z . 'B:\_work\108\a\server-publish.ps1' -packOutput "B:\_work\108\a" -publishProperties @{'WebPublishMethod'='MSDeploy';  'MSDeployServiceURL'='https://server'; 'DeployIisAppPath'='Demo mainSite/dotnetCoreApp';'UserName'='username';'Password'="********"; 'EnvironmentName'='staging'; 'EnableMSDeployBackup'='false';'AllowUntrustedCertificate'='true'} -Verbose 

2017-02-02T15:06:25.0547361Z Executing the following powershell script. (workingFolder = B:\_work\108\s) 

2017-02-02T15:06:25.0547361Z B:\_work\108\a\server-publish.ps1 -packOutput "B:\_work\108\a" -publishProperties @{'WebPublishMethod'='MSDeploy';  'MSDeployServiceURL'='https://server'; 'DeployIisAppPath'='Demo mainSite/dotnetCoreApp';'UserName'='username';'Password'="********"; 'EnvironmentName'='staging'; 'EnableMSDeployBackup'='false';'AllowUntrustedCertificate'='true'} -Verbose 

2017-02-02T15:06:25.6777700Z VERBOSE: Loading module from path 'B:\_work\108\a\publish-module.psm1'. 

2017-02-02T15:06:25.7307946Z VERBOSE: Exporting function 'Register-AspnetPublishHandler'. 

2017-02-02T15:06:25.7307946Z VERBOSE: Exporting function 'Get-AspnetPublishHandler'. 

2017-02-02T15:06:25.7317771Z VERBOSE: Exporting function 'Publish-AspNet'. 

2017-02-02T15:06:25.7327889Z VERBOSE: Exporting function 'Publish-AspNetMSDeploy'. 

2017-02-02T15:06:25.7327889Z VERBOSE: Exporting function 'Publish-AspNetMSDeployPackage'. 

2017-02-02T15:06:25.7337689Z VERBOSE: Exporting function 'Publish-AspNetFileSystem'. 

2017-02-02T15:06:25.7337689Z VERBOSE: Exporting function 'Get-PropertiesFromPublishProfile'. 

2017-02-02T15:06:25.7348209Z VERBOSE: Exporting function 'Get-MSDeploy'. 

2017-02-02T15:06:25.7397836Z VERBOSE: Registering MSDeploy handler 

2017-02-02T15:06:25.7607760Z VERBOSE: Adding handler for [MSDeploy] 

2017-02-02T15:06:25.7637948Z VERBOSE: Registering MSDeploy package handler 

2017-02-02T15:06:25.7647892Z VERBOSE: Adding handler for [Package] 

2017-02-02T15:06:25.7657950Z VERBOSE: Registering FileSystem handler 

2017-02-02T15:06:25.7667860Z VERBOSE: Adding handler for [FileSystem] 

2017-02-02T15:06:25.7677977Z VERBOSE: Importing function 'Get-AspnetPublishHandler'. 

2017-02-02T15:06:25.7677977Z VERBOSE: Importing function 'Get-MSDeploy'. 

2017-02-02T15:06:25.7687917Z VERBOSE: Importing function 'Get-PropertiesFromPublishProfile'. 

2017-02-02T15:06:25.7687917Z VERBOSE: Importing function 'Publish-AspNet'. 

2017-02-02T15:06:25.7697881Z VERBOSE: Importing function 'Publish-AspNetFileSystem'. 

2017-02-02T15:06:25.7707794Z VERBOSE: Importing function 'Publish-AspNetMSDeploy'. 

2017-02-02T15:06:25.7707794Z VERBOSE: Importing function 'Publish-AspNetMSDeployPackage'. 

2017-02-02T15:06:25.7717769Z VERBOSE: Importing function 'Register-AspnetPublishHandler'. 

2017-02-02T15:06:25.8108318Z Publishing with publish method [MSDeploy] 

2017-02-02T15:06:25.8558374Z VERBOSE: Adding default property to publishProperties ["SkipExtraFilesOnServer"="True"] 

2017-02-02T15:06:25.8587850Z VERBOSE: Adding default property to publishProperties ["retryAttempts"="20"] 

2017-02-02T15:06:25.8607935Z VERBOSE: Adding default property to publishProperties ["DeleteExistingFiles"="False"] 

2017-02-02T15:06:25.8618096Z VERBOSE: Adding default property to publishProperties ["MSDeployPackageContentFoldername"="website\"] 

2017-02-02T15:06:25.8638077Z VERBOSE: Adding default property to publishProperties ["AuthType"="Basic"] 

2017-02-02T15:06:25.8647915Z VERBOSE: Adding default property to publishProperties ["MSDeployUseChecksum"="False"] 

2017-02-02T15:06:25.8658376Z VERBOSE: Adding default property to publishProperties ["MSDeployPublishMethod"="WMSVC"] 

2017-02-02T15:06:26.1098668Z VERBOSE: Found msdeploy.exe at [C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe] 

2017-02-02T15:06:26.1168709Z Executing command ["C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:manifest='C:\Users\BuildService\AppData\Local\Temp\PublishTemp\obj\a\SourceManifest.xml' -dest:manifest='C:\Users\BuildService\AppData\Local\Temp\PublishTemp\obj\a\DestinationManifest.xml',ComputerName='https://server:8172/msdeploy.axd?site=Demo%20mainSite/dotnetCoreApp',UserName='username',Password='{{PASSWORD-REMOVED-FROM-LOG}}',IncludeAcls='False',AuthType='Basic' -verb:sync -enableRule:DoNotDeleteRule -retryAttempts:20 -disablerule:BackupRule -allowUntrusted] 

2017-02-02T15:06:26.1218393Z VERBOSE: Found msdeploy.exe at [C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe] 

2017-02-02T15:06:27.2510114Z Info: Using ID '7b0f156a-8f7a-4259-84df-93d9008e6f22' for connections to the remote server. 

2017-02-02T15:06:27.2900134Z ##[error]Error Code: ERROR_USER_UNAUTHORIZEDMore Information: Connected to the remote computer ("server") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.Error: The remote server returned an error: (401) Unauthorized.Error count: 1. 

2017-02-02T15:06:27.2910140Z ##[error]Process completed with exit code 0 and had 1 error(s) written to the error stream. 
言及 this websiteとして
+0

ビルド定義を共有できますか?プロジェクトをどのように展開しましたか? –

+0

イメージを追加しました。テキストを表示する方法はありますか、それで十分でしょうか? – user833831

+0

引数ではなくスクリプトにユーザー名とパスワードを含めるのはどうでしょうか? –

答えて

1

は、ERROR_USER_UNAUTHORIZEDは通常、認証または許可の問題を示し、なぜならあなたのいずれかの次の理由で発生します

  • ユーザーがサイトの場合にIISマネージャーのアクセス権を持っていない
  • ユーザーが存在しません。
  • パスワードが存在しないWeb 管理サービス
  • サイトを使用して接続することは間違ってい

Web管理サービスを使用して接続する場合は、下の解像度を確認していることを確認してください:

    • することは、ユーザー名とパスワードは、サイトは、ユーザーがIISを持っていることを確認し
    • が存在することを
    • 正しいことを確認していることを確認します

        :サイトの範囲

      にマネージャーの権限は、次の手順を試してください

    • IISマネージャーでWebサイトを選択してください。
    • IISマネージャーの権限を開きます。
    • デプロイするユーザーが追加されていることを確認してください。そうでない場合は、[ユーザーを許可]をクリックして追加します。
  • 関連する問題