Export (0) Print
Expand All

Publishing a Cloud Service using the Azure Tools

Updated: July 15, 2013

By using the Azure Tools for Microsoft Visual Studio, you can publish your Azure application directly from Visual Studio. Visual Studio supports integrated publishing to either the Staging or the Production environment of a cloud service.

Before you can publish an Azure application, you must have an Azure subscription. You must also set up a cloud service and storage account to be used by your application. You can set these up at the Azure Management Portal.

ImportantImportant
When you publish, you can select the deployment environment for your cloud service. You must also select a storage account that is used to store the application package for deployment. After deployment, the application package is removed from the storage account. For more information about how to set up these services, see Setting Up Services Required to Publish a Cloud Service from Visual Studio.

When you are developing and testing an Azure application, you can use Web Deploy to publish changes incrementally for your web roles. After you publish your application to a deployment environment, Web Deploy lets you deploy changes directly to the virtual machine that is running the web role. You do not have to package and publish your entire Azure application each time you want to update your web role to test out the changes. With this approach you can have your web role changes available in the cloud for testing without waiting to have your application published to a deployment environment.

Use the following procedures to publish your Azure application and to update a web role by using Web Deploy:

Publish or Package an Azure Application from Visual Studio

When you publish your Azure application, you can do one of the following tasks:

  • Create a service package: You can use this package and the service configuration file to publish your application to a deployment environment from the Management Portal.

  • Publish your Azure project from Visual Studio: To publish your application directly to Azure, you use the Publish Wizard. For information, see Publish Windows Azure Application Wizard.

To create a service package from Visual Studio

  1. When you are ready to publish your application, open Solution Explorer, open the shortcut menu for the Azure project that contains your roles, and choose Publish.

  2. To create a service package only, follow these steps:

    1. On the shortcut menu for the Azure project, choose Package.

    2. In the Package Windows Azure Application dialog box, choose the service configuration for which you want to create a package, and then choose the build configuration.

    3. (optional) To enable Remote Desktop for the cloud service after you publish it, select the Enable Remote Desktop for all Roles check box, and choose the Settings link to configure Remote Desktop.

      For more information, see Using Remote Desktop with Azure Roles.

    4. To create the package, click Package.

      File Explorer shows the file location of the newly created package. You can copy this location so that you can use it from the Azure Management Portal.

    5. To publish this package to a deployment environment, you must use this location as the Package location when you create a cloud service and deploy this package to an environment with the Management Portal. For more information, see How to Create a Cloud Service.

  3. (Optional) To cancel the deployment process, right-click the line item in the activity log and point to Cancel and remove. This stops the deployment process and deletes the deployment environment from Azure.

    noteNote
    To remove this deployment environment after it has been deployed, you must use the Management Portal.

  4. (Optional) After your role instances have started, Visual Studio automatically shows the deployment environment in the Cloud Services node in Server Explorer. From here you can see the status of the individual role instances. See Viewing the State of a Cloud Service using Server Explorer.

    The following illustration shows the role instances while they are still in the Initializing state:

    VST_DeployComputeNode

Update a Web Role as Part of the Development and Testing Cycle

Requirements

These are the requirements to use Web Deploy to update your web role:

  • For development and testing purposes only: The changes are made directly to the virtual machine where the web role is running. If this virtual machine has to be recycled, the changes are lost because the original package that you published is used to recreate the virtual machine for the role. You must republish your application to get the latest changes for the web role.

  • Only web roles can be updated: Worker roles cannot be updated. In addition, you cannot update the RoleEntryPoint in web role.cs.

  • Can only support a single instance of a web role: You cannot have multiple instances of any web role in your deployment environment. However, multiple web roles each with only one instance are supported.

  • You must enable remote desktop connections: This is required so that Web Deploy can use the user and password to connect to the virtual machine to deploy the changes to the server that’s running Internet Information Services (IIS). In addition, you might need to connect to the virtual machine to add a trusted certificate to IIS on this virtual machine. (This enables the remote connection for IIS that is used by Web Deploy to be secure.)

The following procedure assumes that you are using the Publish Windows Azure Application wizard.

To Enable Web Deploy When You Publish Your Application

  1. To enable the Enable Web Deploy for all web roles check box, you must first configure remote desktop connections. For more information, see Using Remote Desktop with Azure Roles.

  2. To enable Web Deploy for all the web roles in your application, select Enable Web Deploy for all web roles.

    A yellow warning triangle is displayed. Web Deploy uses an untrusted, self-signed certificate by default, which is not recommended for uploading sensitive data. If you need to secure this process for sensitive data, you can add a SSL certificate to be used for Web Deploy connections. This certificate needs to be a trusted certificate. For information about how to do this, see the section To Make Web Deploy Secure later in this topic.

  3. Choose the Next button to advance to the Summary screen, and then choose the Publish button to deploy the cloud service.

    The cloud service is published. The virtual machine that is created has remote connections enabled for IIS so that Web Deploy can be used to update your web roles without republishing.

    noteNote
    If you have more than one instance configured for a web role, a warning message is displayed that each web role will be limited to one instance only in the package that’s created to publish your application. Click OK to continue. As stated in the Requirements section, you can have more than one web role but only one instance of each role.

To Update Your Web Role by Using Web Deploy

  1. To use Web Deploy, you must make code changes to the project for any of your web roles in Visual Studio that you want to publish. Right-click this project node in your solution and point to Publish.

    The Publish Web dialog box is displayed.

  2. (Optional) If you added a trusted SSL certificate to use for remote connections for IIS, you can clear the Allow untrusted certificate check box. For information about how to add a certificate to make Web Deploy secure, see the section To Make Web Deploy Secure later in this topic.

  3. To use Web Deploy, the publish mechanism needs the user name and password that you set up for your remote desktop connection when you first published the package.

    1. In User name, type the user name.

    2. In Password, type the password.

    3. (Optional) If you want to save this password in this profile, select Save password.

  4. To publish out the changes to your web role, click Publish.

    The status line displays Publish started. When the publishing has completed, Publish succeeded is displayed. The changes have now been deployed to the web role on your virtual machine. Now you can start your Azure application to test out your changes in the Azure environment.

To Make Web Deploy Secure

  1. Web Deploy uses an untrusted, self-signed certificate by default, which is not recommended for uploading sensitive data. If you need to secure this process for sensitive data, you can add a SSL certificate to be used for Web Deploy connections. This certificate needs to be a trusted certificate, which you obtain from a certificate authority (CA).

    To make Web Deploy secure for each virtual machine for each of your web roles, you must upload the trusted certificate that you want to use for web deploy to the Management Portal. This makes sure that the certificate is added to the virtual machine that is created for the web role when you publish your application.

  2. To add a trusted SSL certificate to IIS to use for remote connections, follow these steps:

    1. To connect to the virtual machine that is running the web role, click the instance of the web role in Server Explorer, and then click Connect using Remote Desktop. For the detailed steps about how to connect to the virtual machine, see Using Remote Desktop with Azure Roles.

      Your browser will prompt you to download an .RDP file.

    2. To add an SSL certificate, open the management service in IIS Manager. In IIS Manager, enable SSL by opening the Bindings link in the Action pane. The Add Site Binding dialog box appears. Choose Add, and then select https in the Type dropdown list. In the SSL certificate list, choose the SSL certificate that you had signed by a CA and that you uploaded to the management portal. For more information, see Configure Connection Settings for the Management Service.

      noteNote
      If you add a trusted SSL certificate, the yellow warning triangle no longer appears in the Publish Wizard.

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft