Azure staging web deploy fails with ERROR_USER_NOT_AUTHORIZED_FOR_CREATEAPP but not for production

杀马特。学长 韩版系。学妹 提交于 2019-12-19 17:41:20

问题


I'm trying automated web site deployment in Azure and I'm at the phase were I run web deploy commands. The command for production works fine and updates the content but the one for staging is failing with the error code in the title.

I'm no sure were the problem is and if it is an authorization one I'm not sure where to set more permissions for the staging account.

This is the production command (which works):

"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package="MyTestingSite.zip" -dest:auto,ComputerName="https://mytestingsite.scm.azurewebsites.net:443/msdeploy.axd?site=MyTestingSite",UserName="$mytestingsite",Password="fromProductionPublishProfile",authtype="Basic" -verb:sync

And this is the one for staging (which fails with ERROR_USER_NOT_AUTHORIZED_FOR_CREATEAPP)

"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package="MyTestingSite.zip" -dest:auto,ComputerName="https://mytestingsite-staging.scm.azurewebsites.net:443/msdeploy.axd?site=MyTestingSite__staging",UserName="$MyTestingSite__staging",Password="fromStagingPublishProfile",authtype="Basic" -verb:sync -verbose

Help is greatly appreciated! Thank you!


回答1:


Azure expecting that site name will be presented twice - in scm.azurewebsites.net:443/msdeploy.axd?site=%SiteNameHere%" and the same value as a parameter, by default value from file SetParameters.xml is used for second.

You may modify this file or pass parameter to msdeploy directly:

-setParam:name="IIS Web Application Name",value="%SiteNameHere%"




回答2:


I managed to find where the problem was ...

In a settings file created by msdeploy.exe I was using the wrong site name. Sadly the documentation was popping up an error that had nothing to do with the wrong site name but only saying that it can't create that site because of the rights. Which somehow, in a twisted Microsoft like way, makes sense.



来源:https://stackoverflow.com/questions/32620562/azure-staging-web-deploy-fails-with-error-user-not-authorized-for-createapp-but

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