Make MSDeploy.exe deploy a msbuild generated .zip package to Azure

a 夏天 提交于 2019-12-11 07:04:39

问题


We have ASP.NET MVC web app that successfully deploys to Azure via "Publish..." in VS (2017). Now how to publish a web package from our Powershell script (run locally or on TFS)?

We do:

MSBuild "webproject.csproj" /t:Package

and webproject.cmd, webproject.zip and some other files generated. In the .cmd file it calls msdeploy.exe. Then with the publish file from Azure, we do:

.\webproject.cmd /T '/M:https://example.scm.azurewebsites.net:443/msdeploy.axd' '/U:USERNAME' '/P:PASSWORD' /a:Basic

and it breaks with:

Error Code: ERROR_NOT_SUPPORTED More Information: Creating a new application is not supported by this server environment. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_NOT_SUPPORTED. Error count: 1.

Yes, we can do it via MSBuild but that uses the version control, not our package, like described at here.


回答1:


The solution is to modify webproject.SetParameters.xml file with the site name and the connection string from the publish settings file. And not to forget set /Y switch to actually publish. And it works great!



来源:https://stackoverflow.com/questions/50799830/make-msdeploy-exe-deploy-a-msbuild-generated-zip-package-to-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!