Deploy Azure Website via MSBuild & WebDeploy, but with which credentials?

Robert Muehsig picture Robert Muehsig · May 8, 2013 · Viewed 8.2k times · Source

I have a very simple ASP.NET MVC 4 application and I can publish it easily to my local or inhouse IIS via WebDeploy.

Deployment to Azure Websites works as expected on my local machine and with Visual Studio:

  1. Go to Azure Website Management
  2. Go to Dashboard
  3. Download the publish profile
  4. Import it in Visual Studio
  5. Publish

If i do this via command-line I get ERROR_USER_UNAUTHORIZED:

msbuild.exe My.Web.csproj /p:DeployOnBuild=true /p:PublishProfile="azure-web - Web Deploy" /p:Configuration=Release 

I can specify a /p:Password=??? parameter, but where can I setup this password? I can only download or reset the publish profile. The publish profile xml has an encrypted password in it and it seems that only Visual Studio is able to read it.

For FTP/Git publishing there is the "deployment user", but I can't use FTP publishing because it is currently not supported from the command-line (this is the exception I got) and this user has nothing to do with web deploy.

Any ideas?

Answer

Robert Muehsig picture Robert Muehsig · May 8, 2013

Found it: The ***.azurewebsites.net.PublishSettings file (which can be downloaded in the management portal) contains the password in clear-text (even if it looks like encrypted).

The inspiration comes from this blog post.