We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Shannon • 8 years ago

It turns out you CAN pass a query string with the deploy.cmd generated, you have to quote the entire parameter like this:

"/m:https://waws-prod-hk1-001.pu
blish.azurewebsites.windows...:443/msdeploy.axd?site=your-site-name"

Aaron Corcoran • 12 years ago

Great post, this saved me some trouble. Quick question, utilizing the default deployment cmd file which is created by MSBuild, how would you pass in the site= parameter. I can get it running from the cmd line, however, when trying to pass this parameter into the default .cmd file that is created, it doesn't like the site= after the /M:

rob • 12 years ago

You can't add the ?site to the M: parameter (as you have discovered).

Instead, you need the value to be in the SetParameters.xml file like what the commenter above you had.

You should be able to get MSBuild to generate the right value for you if you either set it manually/programmatically or include the following in your .csproj file:

<DeployIisAppPath>SiteName</DeployIisAppPath>

Note: if you put that in your .csproj then you probably want to have the same site name in all environments, which is a good practice anyway.

Ed Spencer • 12 years ago

Hi Robert,

Thanks for taking the time to blog this - it came in really handy when we setup our CI pipeline in Bamboo.

Here's another gotcha that I hit that I thought I would post here for others to see.

When we were dunning msdeploy, we were getting an "ERROR_USER_NOT_AUTHORIZED_FOR_IISAPP" error code.

I spent a while looking into it, and eventually worked out that this was being caused by the "projectname.SetParameters.xml" file.

In our SetParameters.xml file, we had a line that looked like this:

<setParameter name="IIS Web Application Name" value="Default Web Site/ProjectName_deploy" />

This obviously wont work with Azure websites as you cannot specify what the name of the application should be - it should have already been setup when you created the site.

We worked around this by putting in an additional script task between the msbuild task and the msdeploy task. This script just does a simple string replace on the duff IIS Web Application Name and replaces it with the correct Azure name.

Thanks again!

Ed

Ben • 10 years ago

It is also possible to override the default SetParameters.xml values at the command line:
-setParam:name="IIS Web Application Name",value=webappname

David • 9 years ago

That worked for me, thanks :)

rob • 12 years ago

Awesome! Thanks Ed :)