Deploy continuously to Azure

With Visual Studio 2013 Update 4 and Visual Studio Online, you can easily set up continuous deployment to Azure VMs.

To automate your deployments, deploy the same way to multiple environments, and run deployment and validation scripts, follow these steps. For less complex scenarios, such as deploying to Azure websites or cloud services, follow the steps to set up continuous deployment from TFVC or Git instead.

Before you start, you'll need:

  • A Visual Studio Online account. If you don't have one, sign up now.

  • A team project. If you haven't created it, find out how.

  • Azure VMs. If you need to create them, here's how.

  • An Azure storage account. Create one here.

  • Release Management for Visual Studio extension. To install in Visual Studio, go to Tools, Extensions and Updates, and search for “Release Management for Visual Studio”.

  • A deployment script.  Find out how to set up and check-in this script here.

Create a release definition

Set stages for each step you need in the release process of your app, along with the environments. You can add stages and environments, too.

  1. In Visual Studio Team Explorer, right-click a build definition and choose Create Release Definition.

    Choose Create Release Definition

  2. Set each stage and its environment. (To skip a stage, do not set its environment.) Dev, QA and Prod stages are created for you automatically.

    Set each stage and its environment

  3. If you don't see any environments:

    1. Add an Azure subscription.

      Add an Azure subscription

    2. Provide Azure subscription details. If you have an Azure subscription file (.publishsettings file) on your computer, you can browse to that file. If you do not have a local copy of this file, you can click the link Download subscription file to get the file. Once you select the file, the tool will detect all the Azure subscriptions available to you and show them in the Subscription Id dropdown list. For the subscription selected, you need to provide a storage account to Release Management tool where the deployment bits can be uploaded during actual deployment.

      Provide Azure subcription details

      You can update the latest VSIX by selecting Tools and then Extensions and Updates… in Visual Studio. You can also download and install it from the Visual Studio Gallery.

    3. Then set your environments.

      Set your environments

  4. Provide the path name and file name of the deployment script that you want to run. Same for the configuration script, if your deployment script needs it. For each environment, provide the credentials for an account that has access to run the script. You can use the same credentials for all environments if you want.

    Provide the name of the deployment script

  5. After you create the release definition, launch the Release Management Client (you'll get asked to install it if you don't have it already).

    Launch the Release Management Client

  6. You can see your release definition in the Release Management Client. If you don't see it automatically, go to Configure Apps, vNext Release Templates.

    View the release definition

Each new build will trigger a release. You can also manually trigger a new release.

Q&A

Q: How can I view and customize the deployment actions for each stage of my release?

A: In the Release Management Client, go to Configure Apps, vNext Release Templates and open your release template. Learn more here.

View and customize deployment actions

Q: How can I use a different Visual Studio Online account for my releases?

A: In the Release Management Client, go to Administration, Settings, and edit the URL.

Use a different Visual Studio Online account

See Also

Other Resources

Deploying Azure Cloud Service using Release Management