|
1 | 1 | ---
|
2 | 2 | title: Configure canary deployments for Azure Linux Virtual Machines
|
3 |
| -description: Learn how to set up a continuous deployment (CD) pipeline. This pipeline updates a group of Azure Linux virtual machines using the canary deployment strategy. |
| 3 | +description: Learn how to set up a classic release pipeline and deploy to Linux virtual machines using the canary deployment strategy. |
4 | 4 | author: moala
|
5 | 5 | tags: azure-devops-pipelines
|
6 | 6 | ms.service: virtual-machines
|
7 | 7 | ms.collection: linux
|
8 | 8 | ms.topic: how-to
|
9 | 9 | ms.tgt_pltfrm: azure-pipelines
|
10 | 10 | ms.workload: infrastructure
|
11 |
| -ms.date: 4/10/2020 |
| 11 | +ms.date: 08/11/2022 |
12 | 12 | ms.author: moala
|
13 | 13 | ms.custom: devops
|
14 |
| - |
15 |
| -#Customer intent: As a developer, I want to learn about CI/CD features in Azure so that I can use Azure DevOps services like Azure Pipelines to build and deploy my applications automatically. |
16 | 14 | ---
|
17 | 15 |
|
18 | 16 | # Configure the canary deployment strategy for Azure Linux Virtual Machines
|
19 | 17 |
|
20 |
| -**Applies to:** :heavy_check_mark: Linux VMs |
| 18 | +**Applies to:** :heavy_check_mark: Linux VMs |
21 | 19 |
|
22 |
| -## Infrastructure as a service (IaaS) - Configure CI/CD |
| 20 | +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. |
23 | 21 |
|
24 |
| -Azure Pipelines provides a fully featured set of CI/CD automation tools for deployments to virtual machines. You can configure a continuous-delivery pipeline for an Azure VM from the Azure portal. |
| 22 | +## Canary deployments |
25 | 23 |
|
26 |
| -This article shows how to set up a CI/CD pipeline that uses the canary strategy for multimachine deployments. The Azure portal also supports other strategies like [rolling](./tutorial-devops-azure-pipelines-classic.md) and [blue-green](./tutorial-azure-devops-blue-green-strategy.md). |
| 24 | +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. |
27 | 25 |
|
28 |
| -### Configure CI/CD on virtual machines |
| 26 | +Using the **Continuous-delivery** feature, you can use the canary strategy to deploy your application from Azure portal. |
29 | 27 |
|
30 |
| -You can add virtual machines as targets to a [deployment group](/azure/devops/pipelines/release/deployment-groups). You can then target them for multimachine updates. After you deploy to machines, view **Deployment History** within a deployment group. This view lets you trace from VM to the pipeline and then to the commit. |
| 28 | +1. Sign in to [Azure portal](https://portal.azure.com/) and navigate to a virtual machine. |
31 | 29 |
|
32 |
| -### Canary deployments |
| 30 | +1. Select **Continuous delivery**, and then select **Configure**. |
33 | 31 |
|
34 |
| -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. |
| 32 | + :::image type="content" source="media/tutorial-devops-azure-pipelines-classic/azure-devops-configure.png" alt-text="A screenshot showing how to navigate to continuous delivery in your VM settings."::: |
35 | 33 |
|
36 |
| -Using the continuous-delivery option, you can configure canary deployments to your virtual machines from the Azure portal. Here is the step-by-step walk-through: |
| 34 | +1. In the configuration panel, select **Use existing** and select your organization/project or select **Create** and create new ones. |
37 | 35 |
|
38 |
| -1. Sign in to the Azure portal and navigate to a virtual machine. |
39 |
| -1. In the leftmost pane of the VM settings, select **Continuous delivery**. Then select **Configure**. |
| 36 | +1. Select your **Deployment group name** from the dropdown menu or create a new one. |
40 | 37 |
|
41 |
| -  |
| 38 | +1. Select your **Build pipeline** from the dropdown menu. |
42 | 39 |
|
43 |
| -1. In the configuration panel, select **Azure DevOps Organization** to choose an existing account or create a new one. Then select the project under which you want to configure the pipeline. |
| 40 | +1. Select **Deployment strategy**, and then select **Canary**. |
44 | 41 |
|
45 |
| -  |
| 42 | + :::image type="content" source="media/tutorial-devops-azure-pipelines-classic/azure-devops-rolling.png" alt-text="A screenshot showing how to configure the canary deployment strategy."::: |
46 | 43 |
|
47 |
| -1. A deployment group is a logical set of deployment target machines that represent the physical environments. Dev, Test, UAT, and Production are examples. You can create a new deployment group or select an existing one. |
48 |
| -1. Select the build pipeline that publishes the package to be deployed to the virtual machine. The published package should have a deployment script named deploy.ps1 or deploy.sh in the deployscripts folder in the package's root folder. The pipeline runs this deployment script. |
49 |
| -1. In **Deployment strategy**, select **Canary**. |
50 |
| -1. Add a "canary" tag to VMs that are to be part of canary deployments. Add a "prod" tag to VMs that are part of deployments made after canary deployment succeeds. Tags help you target only VMs that have a specific role. |
| 44 | +1. Add a "canary" tag to the VMs that will be used in the canary deployment. |
51 | 45 |
|
52 |
| -  |
| 46 | + :::image type="content" source="media/tutorial-devops-azure-pipelines-classic/azure-devops-configure-canary.png" alt-text="A screenshot showing how to add canary tag."::: |
53 | 47 |
|
54 |
| -1. Select **OK** to configure the continuous-delivery pipeline to deploy to the virtual machine. |
| 48 | +1. Select **OK** to configure the classic release pipeline to deploy to your virtual machine. |
55 | 49 |
|
56 |
| -  |
| 50 | + :::image type="content" source="media/tutorial-devops-azure-pipelines-classic/azure-devops-canary-pipeline.png" alt-text="A screenshot showing a classic release pipeline."::: |
57 | 51 |
|
58 |
| -1. The deployment details for the virtual machine are displayed. You can select the link to go to the release pipeline in Azure DevOps. In the release pipeline, select **Edit** to view the pipeline configuration. The pipeline has these three phases: |
| 52 | +1. 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: |
59 | 53 |
|
60 |
| - 1. This phase is a deployment-group phase. Applications are deployed to VMs that are tagged as "canary". |
61 |
| - 1. In this phase, the pipeline pauses and waits for manual intervention to resume the run. |
62 |
| - 1. This is again a deployment group phase. The update is now deployed to VMs tagged as "prod". |
| 54 | + 1. Deploy Canary: the application is deployed to VMs with a "canary" tag. |
| 55 | + 1. 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. |
| 56 | + 1. Deploy Prod: the application is deployed to VMs with a "prod" tag. |
63 | 57 |
|
64 |
| -  |
| 58 | + :::image type="content" source="media/tutorial-devops-azure-pipelines-classic/azure-devops-canary-task.png" alt-text="A screenshot showing release pipeline jobs."::: |
65 | 59 |
|
66 |
| -1. Before resuming the pipeline run, ensure that at least one VM is tagged as "prod". In the third phase of the pipeline, applications are deployed to only those VMs that have the "prod" tag. |
| 60 | +## Resources |
67 | 61 |
|
68 |
| -1. The Execute Deploy Script task by default runs the deployment script deploy.ps1 or deploy.sh. The script is in the deployscripts folder in the root folder of the published package. Ensure that the selected build pipeline publishes the deployment in the root folder of the package. |
| 62 | +- [Deploy to Azure virtual machines with Azure DevOps](../../devops-project/azure-devops-project-vms.md) |
| 63 | +- [Deploy to an Azure virtual machine scale set](/azure/devops/pipelines/apps/cd/azure/deploy-azure-scaleset) |
69 | 64 |
|
70 |
| -  |
| 65 | +## Related articles |
71 | 66 |
|
72 |
| -## Other deployment strategies |
73 | 67 | - [Configure the rolling deployment strategy](./tutorial-devops-azure-pipelines-classic.md)
|
74 | 68 | - [Configure the blue-green deployment strategy](./tutorial-azure-devops-blue-green-strategy.md)
|
75 |
| - |
76 |
| -## Azure DevOps Projects |
77 |
| - |
78 |
| -You can get started with Azure easily. With Azure DevOps Projects, start running your application on any Azure service in just three steps by selecting: |
79 |
| - |
80 |
| -- An application language |
81 |
| -- A runtime |
82 |
| -- An Azure service |
83 |
| - |
84 |
| -[Learn more](https://azure.microsoft.com/features/devops-projects/). |
85 |
| - |
86 |
| -## Additional resources |
87 |
| - |
88 |
| -- [Deploy to Azure virtual machines by using Azure DevOps Projects](../../devops-project/azure-devops-project-vms.md) |
89 |
| -- [Implement continuous deployment of your app to an Azure virtual machine scale set](/azure/devops/pipelines/apps/cd/azure/deploy-azure-scaleset) |
0 commit comments