Deploy your ASP.NET app to an Azure cloud service

Last Update: 4/27/2017

Team Services | TFS 2017 | TFS 2015 | Previous versions: XAML Build, Release

Continuous deployment means starting an automated deployment process whenever a new successful build is available. Here we'll show you how to set up continuous deployment of your ASP.NET app to an Azure cloud service using Release Management.

You can also use these steps to deploy your app to an Azure Government Cloud by creating a suitable service endpoint for your Azure Government Cloud subscription. For more details, see the Azure Government Cloud deployments.

Get set up

Begin with a CI build

Before you begin, you'll need a CI build that publishes your Cloud Service package. To set up CI, see:

Azure storage

An Azure blob storage container is required for deploying to Azure cloud services. Carry out the following steps in the Azure portal to create one.

  1. Sign into the Azure management portal and choose the +New icon in the left panel, then choose Data + Storage. Select Storage Account from the list.

  2. At the bottom of the Storage Account blade, in the Select a deployment model list, choose Classic and then choose Create.

  3. In the Create Storage Account blade:

    • Enter a name for the new storage account.
    • Select an existing Resource Group, or create a new one.
    • Select a location for the new storage account.
    • Leave all the other settings at their default values, and choose Create.

  4. After the storage account has been created, open its blade and choose the Blobs tile. In the Blob service blade, choose the Containers tile and, in the Container blade, choose the +Container icon at the top to create a new container.

  5. In the New Container blade, type a name for the container. Select Container in the Access type list, and choose Create.

Define and test your CD release process

Continuous deployment (CD) means starting an automated release process whenever a new successful build is available. Your CD release process picks up the artifacts published by your CI build and then deploys them to your Azure cloud service.

  1. Do one of the following:

    • If you've just completed a CI build (see above) then, in the build's Summary tab under Deployments, choose Create release followed by Yes. This starts a new release definition that's automatically linked to the build definition.

    • Open the Releases tab of the Build & Release hub, open the + drop-down in the list of release definitions, and choose Create release definition.

  2. Select the Azure Cloud Service Deployment template and click Next.

  3. In Source... make sure your CI build definition that creates the cloud services artifacts is selected.

  4. Select the Continuous deployment check box, and then choose Create.

  5. Select the Azure Cloud Service Deployment task and configure it as follows:

    Task step Parameters
    icon
    Deploy: Azure Cloud Service Deployment
    Deploy the app to an Azure cloud service.
    Azure Subscription (Classic): Select an Azure Classic service endpoint. If you have not created one already, create one now by choosing Add. Then return to your release definition, refresh the Azure Subscription list, and select the connection you just created.
    Storage account: Select the storage account you created earlier.
    Service name: Select the name of an existing cloud service, or enter the name of a new cloud service.

    If your Azure subscription is defined in an Azure Government Cloud, ensure your deployment process meets the relevant compliance requirements. For more details, see Azure Government Cloud deployments.

  6. Edit the name of the release definition, click Save, and click OK. Note that the default environment is named Environment1, which you can edit by clicking directly on the name.

You're now ready to create a release, which means to start the process of running the release definition with the artifacts produced by a specific build. This will result in deploying the build to Azure:

  1. Choose + Release and select Create Release.

  2. Select the build you just completed in the highlighted drop-down list and choose Create.

  3. Choose the release link in the popup message. For example: "Release Release-1 has been created".

  4. Open the Logs tab to watch the release console output.

  5. After the release is complete, navigate to your site running in Azure cloud services and verify its contents.

Q&A

I use Team Foundation Server on-premises and I don't see some of these features. Why not?

Some of these features are available only on Visual Studio Team Services and not yet available on-premises. Some features are available on-premises if you have upgraded to the latest version of TFS.

Help and support