Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 761
Robert Muehsig Avatar asked May 08 '13 06:05

Robert Muehsig


People also ask

How do I make Azure web app using Visual Studio?

Open Visual Studio and then select Create a new project. In Create a new project, find, and select ASP.NET Web Application (. NET Framework), then select Next. In Configure your new project, name the application MyFirstAzureWebApp, and then select Create.


1 Answers

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.

like image 126
Robert Muehsig Avatar answered Oct 17 '22 23:10

Robert Muehsig