WebDeploy on Azure Websites using the command line

 

image.png

The deployment of ASP.NET applications on Azure websites in Visual Studio is pretty easy. With the new Azure SDK it is possible to import your Azure subscription and directly choose the already created Azure Website as deployment-destination:

image

image

 

The deployment information’s are saved in a .pubxml file in the project. It includes all information’s – besides the password.

Visual Studio saves the password somewhere else. Besides it is not a very clean process to deploy out of Visual Studio it would be a better way to have a build system build the WebDeploy package and publish the project later on a random Azure website or a local IIS.

How to publish a WebDeploy Package with an CMD?

If you use MSBuild for example to build a WebDeploy Package you will receive a Batch-file beside the main package where you can start the process.

image

If you run the file like this you will see a ReadMe file. Important for Azure Websites: you need a password to deploy!

How can I find the WebDeploy password for Azure Websites?

The only way I know is to download the Publishing-Profile using the Web-Management-Tool. The WebDeploy password isn’t connected to the FTP/GIT-password which can be set in addition!

image

This file shows the uncoded but still cryptical password:

image

TL;DR – the CMD order:

That’s how it looks like in my example:

WebDeployPackage.deploy.cmd /y "/m:https://waws-prod-am2-001.publish.azurewebsites.windows.net/MsDeploy.axd?Site=blogpostsample" -allowUntrusted /u:"$blogpostsample" /p:"AssmJvtBrcWqfjaoHiANseLfyLuyJ1zyMn44L8YGQNKLCA9Rd9CZesxe9ilJ" /a:Basic

You have to adapt the URL (/m:) (changes depending on the region), the site, the password (/p:) and the user (/u:). The information’s are available in the publishing-profile.

Additional you have to adapt the IIS App Name in the SetParameters.xmls file:

<?xml version="1.0" encoding="utf-8"?><parameters> <setParameter name="IIS Web Application Name" value="blogpostsample" /></parameters>

Now you should be able to deploy directly on the Azure Website with the command line without any other tools.

Source:

I’ve got the solution after reading this blogpost – I’ve already asked the question on Stackoverflow myself.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

About the author

Written by

Learn more about our team.

Comment on this post

Recent Posts

  • How to access an Azure Website with the local IIS Manager

      Since the end of February it is possible to access an Azure Website with the IIS Manager. Although the Azure Management site offers some information’s there are more details visible at the IIS Manager.   For the connection you will need an IIS Manager and the IIS Manager for Remote Administration Extension. It’s also […]

  • image1929-570x143_thumb.png
    Create and validate own Json-Web-Tokens (JWTs)

    If you are interested in web authentication you probably have heard about JSON Web tokens (JWT). What is a JWT? Maybe I’m not using the correct security termination but however: JWTs are used to exchange claims between two systems. For example: You want to log on to a service (like Facebook, Twitter, etc.) and want […]

  • Micro-Optimization: how to shrink or „embed“ pictures

      I’m currently working on the “CodeInside Dashboard” and since the page structure isn’t that difficult it should be possible to fulfill all of Google Pagespeed or Yahoos YSlow recommendations. One of the rules was to optimize the 4 PNGs that are embedded on the page.   Before – without optimization: Below you can see […]

  • image1979-570x194.png
    Move to Windows Azure – VMs, Word Press Migration, DNS changes

    Since mid January this blogs runs on a WordPress installation in an Azure VM. Because I always thought that the subject is quite complicated this blogpost offers a view behind the scenes. Why this move? So far this blog (both German and English Version) runs on a hoster somewhere in Germany. The main problem with this […]

  • Windows Azure Active Directory – CRUD for users and groups

      Windows Azure Active Directory? If you are not informed about the subject I recommend you to have a look on this Azure Info site. Which resources are there? The Azure AD contains the following entities: - Users - Groups - Contacts - Roles Access to the directory or on the “directory graph” Although the […]

Support us