Configure the canary deployment strategy for Azure Linux Virtual Machines

Applies to: ✔️ Linux VMs

Azure Pipelines provides a fully featured set of CI/CD automation tools for deployments to virtual machines. This article will show you how to set up a classic release pipeline that uses the canary strategy to deploy web applications to Linux virtual machines.

Canary deployments

A canary deployment reduces risk by slowly rolling out changes to a small subset of users. As you gain confidence in the new version, you can release it to more servers in your infrastructure and route more users to it.

Using the Continuous-delivery feature, you can use the canary strategy to deploy your application from Azure portal.

  1. Sign in to Azure portal and navigate to a virtual machine.

  2. Select Continuous delivery, and then select Configure.

    A screenshot showing how to navigate to continuous delivery in your VM settings.

  3. In the configuration panel, select Use existing and select your organization/project or select Create and create new ones.

  4. Select your Deployment group name from the dropdown menu or create a new one.

  5. Select your Build pipeline from the dropdown menu.

  6. Select Deployment strategy, and then select Canary.

    A screenshot showing how to configure the canary deployment strategy.

  7. Add a "canary" tag to the VMs that will be used in the canary deployment.

    A screenshot showing how to add canary tag.

  8. Select OK to configure the classic release pipeline to deploy to your virtual machine.

    A screenshot showing a classic release pipeline.

  9. Navigate to your release pipeline and then select Edit to view the pipeline configuration. In this example, the dev stage is composed of three jobs:

    1. Deploy Canary: the application is deployed to VMs with a "canary" tag.
    2. Wait for manual resumption: the pipeline pauses and waits for manual intervention. Before resuming the pipeline, ensure that at least one VM is tagged "prod". In the next phase, the app will be deployed only to "prod" VMs.
    3. Deploy Prod: the application is deployed to VMs with a "prod" tag.

    A screenshot showing release pipeline jobs.