Azure staging web deploy fails with ERROR_USER_NOT

2019-06-23 16:18发布

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!

2条回答
乱世女痞
2楼-- · 2019-06-23 16:46

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.

查看更多
Root(大扎)
3楼-- · 2019-06-23 16:50

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%"

查看更多
登录 后发表回答