私はAzureに "Web app"を持っています。このWebアプリケーションには、Visual Studioを使って.Net Webアプリケーションを配備/公開しています。 (ビルド - >パブリッシュ)、それが動作します。Powershellを使用して.Net WebアプリケーションをAzureにデプロイする方法
Powershellスクリプトを使用してアプリケーションを展開/公開できるようにします。
Build FAILED.
"c:\Users\jgodse\Documents\Visual Studio 2015\Projects\WebApplication1\WebApplication1.sln" (default target) (1) ->
"c:\Users\jgodse\Documents\Visual Studio 2015\Projects\WebApplication1\WebApplication1\WebApplication1.csproj" (default target) (2) ->
(MSDeployPublish target) ->
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5): msdeploy error ERROR_USER_UNAUTHORIZED: Web deployment task failed. (Connected to the remote computer ("jg-7-web-app-1.scm.azurewebsites.net") 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.) [c:\Users\jgodse\Documents\Visual Studio 2015\Projects\WebApplication1\WebApplication1\WebApplication1.csproj]
0 Warning(s)
1 Error(s)
:私はエラーを得た
CMD> "c:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe" WebApplication1.sln /p:DeployOnBuild=true /p:PublishProfile="C:\Users\jgodse\Documents\Visual Studio 2015\Projects\WebApplication1\WebApplication1\Properties\PublishProfiles\jg-7-web-app-1 - Web Deploy.pubxml" /p:Configuration=Release
:
CMD> "c:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe" WebApplication1.sln
は、私はいくつかのパラメータを追加する必要があり、それはまた、展開できるようにするには:私は、ビルド部分のために働くために、次のスクリプトを得ました
私は明らかにAzureの資格情報がなくなっています(Visual Studioがそれらを取得できるようになっているのを見て)、Powershellでも実行していません。
だから私は、全体の指揮を執ったし、ファイルに入れて DEPLOY.BAT と呼ばれる、PowerShellウィンドウを開いて、次のことをやった。(私は私のユーザー/パスワードで入力
PS> Login-AzureRmAccount
GUIポップアップ)。
PS> cmd /c .\deploy.bat
ビルドは正常でしたが、パブリッシュしようとしたときに同じエラーが発生しました。私はAzureの資格情報がCMDプログラムに砲撃するときに運ばなかったと思います。
私の.NETプロジェクトでMSBuildを呼び出してPowershellを使用してAzure Webアプリケーションに公開するにはどうすればよいですか?
ありがとうございます。それはまさに私が必要としたものでした。 –