Wednesday, 27 July 2011

Publishing to Azure environment directly from Visual Studio (with Azure SDK v1.3)


The Azure applications can be published in two ways to Azure Environment.
  1. Manual Publish – Create Package from Visual Studio and upload the package to Azure environment using Management Portal.
  2. Publish Direct from Visual Studio – Setup Azure Project in Visual Studio to publish directly to Azure environment without Management Portal.

This post concentrates on second Method, Publish Directly from Visual Studio.

  1. Prepare the Azure Project

    I am taking a sample fresh new Web Role Application for demo purpose.

  2. Create Hosting Service from Management Portal

    Before deploying any application to Azure environment from Visual Studio, it is required to create a Hosting Service for that. When creating Hosting Service, there is no need to upload the package for the service as the deployment done by Visual Studio. So select Do not deploy option in the Create a New Hosting Service window and Deployment name, Package Location and Configuration file inputs are not required.


    If the Hosting Service already created before, it is possible to link the service from Visual Studio. The requirement here is to have a Hosting Service before deploying the service from Visual Studio.

  3. Create Certificate when publishing the Azure application.
    1. Right click the Azure application and select Publish option. It will open Deploy Windows Azure project window.
    2. Select Deploy your Windows Azure Project to Windows Azure option and select Add option from Credentials drop down box.


      It will open Windows Azure Project Management Authentication window.
    3. Select Create. It will prompt to enter Certificate Name.


    4. Enter Certificate Name and Press OK.


    5. In the Windows Azure Project Management Authentication window copy the full path of the certificate by selecting Copy the full path link. (Note: The certificate will be stored in this location. This path is required to select the certificate and link in Management Portal)



    6. Before doing any further action, it is important to link the certificate in Azure Management Portal. So after uploading the certificate in Management Portal, we can resume this publish.
  4. Uploading Certificate in Management Portal

    1. Open the Management Portal and select the Subscription. Note Subscription ID from the Properties of the service from right section.


    2. In Management Portal select Management Certificate. The portal will show list of subscription and the certificate in the center section.
    3. Select Add Certificate option from the top of the screen.


    4. In the Add New Management Certificate window, select the subscription and select the certificate file where the path selected from Visual Studio.
      (Press Browse button, the system will open Browse window. Paste the full path copied from Copy the full path link from Azure Project Manegement Authenticate window and selects the Certificate located in that location with the Certificate Name entered before.



    5. Once the certificate created the certificate will be listed under the subscription name at Management Certificate option.


  5. Publish the Azure Project

    Now the certificate linked with the Management Portal. This step resumes from Step 3 i.e. Windows Azure Project Management Authentication window.

    1. Enter the Subscription ID. The Subscription ID already noted while uploading certificate.
    2. Provide any friendly name for Name these credentials and press OK.


    3. In the Deploy Windows Azure Project window click the Development environment to deploy to dropdown box. It will show list of deployable environment under the subscription provided.


    4. Select the Hosting Service environment which required deploying from Visual Studio.


    5. If any storage account linked with the project you can select. If no storage account leave the default value selected.
    6. If the previous deployment required to be overwritten with the new deployment, select Prompt before deleting an existing deployment option. By default it will be selected. So leave it.
    7. If required, change the Deployment Lable value and press OK.
  6. Visual Studio will authenticate with the Management Portal certificate and upload the package directly to Azure environment. You can verify the status of publish from Visual Studio or from Management Portal. The management Portal will show the progress which is going on at the selected Hosting Service once the Visual Studio uploaded the package and started the process. Below figure shows the status both in Visual Studio and Management Portal at same time.

0 Responses to “Publishing to Azure environment directly from Visual Studio (with Azure SDK v1.3)”

Post a Comment