Continuous deployment to Azure App Service

This article shows you how to configure continuous deployment for Azure App Service. App Service enables continuous deployment from BitBucket, GitHub, and Azure DevOps Services by pulling in the most recent updates from your existing repository in one of these services.

To find out how to configure continuous deployment manually from a cloud repository not listed by the Azure portal (such as GitLab), see Setting up continuous deployment using manual steps.

Prepare your repository

To get automatic builds from the App Service Kudu build server, make sure that your repository root has the correct files in your project.

Runtime Root directory files
ASP.NET (Windows only) *.sln, *.csproj, or default.aspx
ASP.NET Core *.sln or *.csproj
PHP index.php
Ruby (Linux only) Gemfile
Node.js server.js, app.js, or package.json with a start script
Python (Windows only) *.py, requirements.txt, or runtime.txt
HTML default.htm, default.html, default.asp, index.htm, index.html, or iisstart.htm
WebJobs <job_name>/run.<extension> under App_Data/jobs/continuous (for continuous WebJobs) or App_Data/jobs/triggered (for triggered WebJobs). For more information, see Kudu WebJobs documentation
Functions See Continuous deployment for Azure Functions.

To customize your deployment, include a .deployment file in the repository root. For more information, see Customizing deployments and Custom deployment script.

Note

If you develop in Visual Studio, let Visual Studio create a repository for you. The project is immediately ready to be deployed using Git.

Publish your prepared repository to one of the supported services. For more information on publishing your project to these services, see Create a repo (GitHub), Create a repo (BitBucket), and Get started with Azure DevOps Services.

Deploy continuously from GitHub

To enable continuous deployment with GitHub, navigate to your App Service app page in the Azure portal.

In the left menu, click Deployment Center > GitHub > Authorize. Follow the authorization prompts.

You only need to authorize with GitHub once. If you're already authorized, just click Continue. You can change the authorized GitHub account by clicking Change account.

In the Build provider page, choose the build provider and click > Continue.

Option 1: use App Service Kudu build server

In the Configure page, select the organization, repository, and branch from which you want to deploy continuously. When finished, click Continue.

Option 2: use Azure DevOps Services continuous delivery

Note

For App Service to create the necessary Azure Pipelines in your Azure DevOps Services organization, your Azure account must have the role of Owner in your Azure subscription.

In the Configure page, in the Code section, select the organization, repository, and branch from which you want to deploy continuously. When finished, click Continue.

In the Configure page, in the Build section, configure a new Azure DevOps Services organization or specify an existing organization. When finished, click Continue.

Note

If you want to use an existing Azure DevOps Services organization that is not listed, you need to link the Azure DevOps Services organization to your Azure subscription.

In the Test page, choose whether to enable load tests, then click Continue.

Depending on the pricing tier of your App Service plan, you may also see a Deploy to staging page. Choose whether to enable deployment slots, then click Continue.

Finish configuration

In the Summary page, verify your options and click Finish.

When configuration completes, new commits in the selected repository are deployed continuously into your App Service app.

Deploy continuously from BitBucket

To enable continuous deployment with BitBucket, navigate to your App Service app page in the Azure portal.

In the left menu, click Deployment Center > BitBucket > Authorize. Follow the authorization prompts.

You only need to authorize with BitBucket once. If you're already authorized, just click Continue. You can change the authorized BitBucket account by clicking Change account.

In the Configure page, select the repository and branch from which you want to deploy continuously. When finished, click Continue.

In the Summary page, verify your options and click Finish.

When configuration completes, new commits in the selected repository are deployed continuously into your App Service app.

Deploy continuously from Azure DevOps Services

To enable continuous deployment with Azure DevOps Services, navigate to your App Service app page in the Azure portal.

In the left menu, click Deployment Center > Azure DevOps Services > Continue.

In the Build provider page, choose the build provider and click > Continue.

Option 1: use App Service Kudu build server

In the Configure page, select the Azure DevOps Services organization, project, repository, and branch from which you want to deploy continuously. When finished, click Continue.

Option 2: use Azure DevOps Services continuous delivery

Note

For App Service to create the necessary Azure Pipelines in your Azure DevOps Services organization, your Azure account must have the role of Owner in your Azure subscription.

In the Configure page, in the Code section, select the Azure DevOps Services organization, project, repository, and branch from which you want to deploy continuously. When finished, click Continue.

Note

If you want to use an existing Azure DevOps Services organization that is not listed, you need to link the Azure DevOps Services organization to your Azure subscription.

In the Configure page, in the Build section, specify the language framework that Azure DevOps Services should use to run the build tasks for your selected repository. When finished, click Continue.

In the Test page, choose whether to enable load tests, then click Continue.

Depending on the pricing tier of your App Service plan, you may also see a Deploy to staging page. Choose whether to enable deployment slots, then click Continue.

Finish configuration

In the Summary page, verify your options and click Finish.

When configuration completes, new commits in the selected repository are deployed continuously into your App Service app.

Disable continuous deployment

To disable continuous deployment, navigate to your App Service app page in the Azure portal.

In the left menu, click Deployment Center > GitHub or Azure DevOps Services or BitBucket > Disconnect.

What happens to my app during deployment?

All the officially supported deployment methods have one thing in common: they make changes to the files in the /site/home/wwwroot folder of your app. These are the same files that are run in production. Therefore, the deployment can fail due to locked files, or the app in production may have unpredictable behavior during deployment because not all the files are updated simultaneously. There are a few different ways to avoid these issues:

Additional Resources