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!
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%"
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With