Deploy to Azure web app

VSTS | TFS 2017 Update 2

We'll show you how to set up continuous deployment of your ASP.NET or Node app to an Azure web app using Visual Studio Team Services (VSTS) or Microsoft Team Foundation Server (TFS). You can use the steps in this quickstart as long as your continuous integration process publishes a Web Deploy package.

Prerequisites

Before you begin, you'll need a CI build that publishes your Web Deploy package. To set up CI for your specific type of app, see:

You'll also need an Azure web app where you will deploy the app. If you don't have one already, create one now. If you need help, follow the steps in this example.

Define your CD release process

Your CD release process picks up the artifacts published by your CI build and then deploys them to your Azure web site.

  1. Do one of the following to start creating a release definition:

    • If you've just completed a CI build (see above), choose the link (for example, Build 20170815.1) to open the build summary. Then choose Release to start a new release definition that's automatically linked to the build definition.

      Creating a new release definition from the build summary

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

      Creating a new release definition in the Releases page

  2. The easiest way to create a release definition is to use a template. If you are deploying a Node app, select the Deploy Node.js App to Azure App Service template. Otherwise, select the Azure App Service Deployment template. Then choose Apply.

    The only difference between these templates is that Node template configures the task to generate a web.config file containing a parameter that starts the iisnode service.

  3. If you created your new release definition from a build summary, check that the build definition and artifact is shown in the Artifacts section on the Pipeline tab. If you created a new release definition from the Releases tab, choose the + Add link and select your build artifact.

    Checking or selecting the build definition and artifact

  4. Choose the Continuous deployment icon in the Artifacts section, check that the continuous deployment trigger is enabled, and the master branch is selected. If not, set these options now.

    Checking or setting the Continuous deployment trigger

    Continuous deployment is not enabled by default when you create a new release definition from the Releases tab.

  5. Open the Task tab, select the Deploy Azure App Service task, and configure it as follows:

    Deploy: Azure App Service Deploy Deploy: Azure App Service Deploy task - deploy the app to Azure App Services.

    • Azure Subscription: Select a connection from the list under Available Azure Service Connections or create a more restricted permissions connection to your Azure subscription. If you are using VSTS and if you see an Authorize button next to the input, click on it to authorize VSTS to connect to your Azure subscription. If you are using TFS or if you do not see the desired Azure subscription in the list of subscriptions, see Azure Resource Manager service endpoint to manually set up the connection.

      Authorizing an Azure subscription

    • App Service Name: Select the name of the web app from your subscription.

  6. Save the release definition.

Create a release to deploy your app

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:

  1. Choose + Release and select Create Release.

  2. In the Create new release dialog, check that the artifact version you want to use is selected and choose Queue.

  3. Choose the release link in the information bar 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 using the Web App URL http://{web_app_name}.azurewebsites.net, and verify its contents.

Next steps