|
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 blue-green deployment strategy. |
| 3 | +description: Learn how to set up a classic release pipeline and deploy to Linux virtual machines using the blue-green 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/08/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 blue-green deployment strategy for Azure Linux virtual machines
|
19 | 17 |
|
20 |
| -**Applies to:** :heavy_check_mark: Linux VMs |
21 |
| - |
22 |
| -## Infrastructure as a service (IaaS) - Configure CI/CD |
| 18 | +**Applies to:** :heavy_check_mark: Linux VMs |
23 | 19 |
|
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. |
| 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 blue-green strategy to deploy to Linux virtual machines. Azure also supports other strategies like [rolling](./tutorial-devops-azure-pipelines-classic.md) and [canary](./tutorial-azure-devops-canary-strategy.md) deployments. |
25 | 21 |
|
26 |
| -This article shows how to set up a CI/CD pipeline that uses the blue-green strategy for multimachine deployments. The Azure portal also supports other strategies like [rolling](./tutorial-devops-azure-pipelines-classic.md) and [canary](./tutorial-azure-devops-canary-strategy.md). |
| 22 | +## Blue-green deployments |
27 | 23 |
|
28 |
| -### Configure CI/CD on virtual machines |
| 24 | +A blue-green deployment is a deployment strategy where you create two separate and identical environments but only one is live at any time. This strategy is used to increase availability and reduce downtime by switching between the blue/green environments. The blue environment is usually set to run the current version of the application while the green environment is set to host the updated version. When all updates are completed, traffic is directed to the green environment and blue environment is set to idle. |
29 | 25 |
|
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. |
| 26 | +Using the **Continuous-delivery** feature, you can use the blue-green deployment strategy to deploy to your virtual machines from Azure portal. |
31 | 27 |
|
32 |
| -### Blue-green deployments |
| 28 | +1. Sign in to [Azure portal](https://portal.azure.com/) and navigate to a virtual machine. |
33 | 29 |
|
34 |
| -A blue-green deployment reduces downtime by having an identical standby environment. Only one environment is live at any time. |
| 30 | +1. ISelect **Continuous delivery**, and then select **Configure**. |
35 | 31 |
|
36 |
| -As you prepare for a new release, complete the final stage of testing in the green environment. After the software works in the green environment, switch traffic so that all incoming requests go to the green environment. The blue environment is idle. |
| 32 | +  |
37 | 33 |
|
38 |
| -Using the continuous-delivery option, you can configure blue-green 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. |
39 | 35 |
|
40 |
| -1. Sign in to the Azure portal and navigate to a virtual machine. |
41 |
| -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. |
42 | 37 |
|
43 |
| -  |
| 38 | +1. Select your **Build pipeline** from the dropdown menu. |
44 | 39 |
|
45 |
| -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 the **Deployment strategy** dropdown menu, and then select **Blue-Green**. |
46 | 41 |
|
47 |
| -  |
| 42 | +  |
48 | 43 |
|
49 |
| -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. |
50 |
| -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. |
51 |
| -1. In **Deployment strategy**, select **Blue-Green**. |
52 |
| -1. Add a "blue" or "green" tag to VMs that are to be part of blue-green deployments. If a VM is for a standby role, tag it as "green". Otherwise, tag it as "blue". |
| 44 | +1. Add a "blue" or "green" tag to VMs that are used for blue-green deployments. If a VM is for a standby role, tag it as "green". Otherwise, tag it as "blue". |
53 | 45 |
|
54 |
| -  |
| 46 | +  |
55 | 47 |
|
56 |
| -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. |
57 | 49 |
|
58 |
| -  |
| 50 | +  |
59 | 51 |
|
60 |
| -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: |
61 | 53 |
|
62 |
| - 1. This phase is a deployment-group phase. Applications are deployed to standby VMs, which are tagged as "green". |
63 |
| - 1. In this phase, the pipeline pauses and waits for manual intervention to resume the run. Users can resume the pipeline run once they have manually ensured stability of deployment to VMs tagged as "green". |
64 |
| - 1. This phase swaps the "blue" and "green" tags in the VMs. This ensures that VMs with older application versions are now tagged as "green". During the next pipeline run, applications will be deployed to these VMs. |
| 54 | + 1. Deploy Green: the app is deployed to a standby VM tagged "green". |
| 55 | + 1. Wait for manual resumption: the pipeline pauses and waits for manual intervention. |
| 56 | + 1. Swap Blue-Green: this job swaps the "blue" and "green" tags in the VMs. This ensures that VMs with older application versions are now tagged as "green". During the next pipeline run, applications will be deployed to these VMs. |
65 | 57 |
|
66 |
| -  |
| 58 | +  |
67 | 59 |
|
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. |
| 60 | +## Resources |
69 | 61 |
|
70 |
| -  |
| 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) |
71 | 64 |
|
72 |
| -## Other deployment strategies |
| 65 | +## Related articles |
73 | 66 |
|
74 | 67 | - [Configure the rolling deployment strategy](./tutorial-devops-azure-pipelines-classic.md)
|
75 | 68 | - [Configure the canary deployment strategy](./tutorial-azure-devops-canary-strategy.md)
|
76 |
| - |
77 |
| -## Azure DevOps Projects |
78 |
| - |
79 |
| -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: |
80 |
| - |
81 |
| -- An application language |
82 |
| -- A runtime |
83 |
| -- An Azure service |
84 |
| - |
85 |
| -[Learn more](https://azure.microsoft.com/features/devops-projects/). |
86 |
| - |
87 |
| -## Additional resources |
88 |
| - |
89 |
| -- [Deploy to Azure virtual machines by using Azure DevOps Projects](../../devops-project/azure-devops-project-vms.md) |
90 |
| -- [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