Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure staging web deploy fails with ERROR_USER_NOT_AUTHORIZED_FOR_CREATEAPP but not for production

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!

like image 872
mosu Avatar asked Sep 16 '15 23:09

mosu


2 Answers

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

like image 81
Danila Polevshchikov Avatar answered Nov 25 '22 16:11

Danila Polevshchikov


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.

like image 40
mosu Avatar answered Nov 25 '22 17:11

mosu