Skip to content

Commit 86a8d4f

Browse files
authored
Merge pull request #207412 from ramiMSFT/pipeline/1973071
Blue-green deployments
2 parents f2956e7 + 7f35a9b commit 86a8d4f

File tree

1 file changed

+28
-50
lines changed

1 file changed

+28
-50
lines changed
Lines changed: 28 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,68 @@
11
---
22
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.
44
author: moala
55
tags: azure-devops-pipelines
66
ms.service: virtual-machines
77
ms.collection: linux
88
ms.topic: how-to
99
ms.tgt_pltfrm: azure-pipelines
1010
ms.workload: infrastructure
11-
ms.date: 4/10/2020
11+
ms.date: 08/08/2022
1212
ms.author: moala
1313
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.
1614
---
1715

1816
# Configure the blue-green deployment strategy for Azure Linux virtual machines
1917

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
2319

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.
2521

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
2723

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.
2925

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.
3127

32-
### Blue-green deployments
28+
1. Sign in to [Azure portal](https://portal.azure.com/) and navigate to a virtual machine.
3329

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**.
3531

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+
![A screenshot showing how to navigate to the continuous delivery feature.](media/tutorial-devops-azure-pipelines-classic/azure-devops-configure.png)
3733

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.
3935

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.
4237

43-
![The Continuous delivery pane with the Configure button](media/tutorial-devops-azure-pipelines-classic/azure-devops-configure.png)
38+
1. Select your **Build pipeline** from the dropdown menu.
4439

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**.
4641

47-
![The Continuous delivery panel](media/tutorial-devops-azure-pipelines-classic/azure-devops-rolling.png)
42+
![A screenshot showing how to configure a blue green continuous delivery strategy.](media/tutorial-devops-azure-pipelines-classic/azure-devops-rolling.png)
4843

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".
5345

54-
![The Continuous delivery panel, with the Deployment strategy value Blue-Green chosen](media/tutorial-devops-azure-pipelines-classic/azure-devops-blue-green-configure.png)
46+
![A screenshot showing a blue-green deployment strategy tagged green.](media/tutorial-devops-azure-pipelines-classic/azure-devops-blue-green-configure.png)
5547

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.
5749

58-
![The blue-green pipeline](media/tutorial-devops-azure-pipelines-classic/azure-devops-blue-green-pipeline.png)
50+
![A screenshot showing the classic release pipeline.](media/tutorial-devops-azure-pipelines-classic/azure-devops-blue-green-pipeline.png)
5951

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:
6153

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.
6557

66-
![The Deployment group pane for the Deploy Blue-Green task](media/tutorial-devops-azure-pipelines-classic/azure-devops-blue-green-tasks.png)
58+
![A screenshot showing the three pipeline jobs](media/tutorial-devops-azure-pipelines-classic/azure-devops-blue-green-tasks.png)
6759

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
6961

70-
![The Artifacts pane showing deploy.sh in the deployscripts folder](media/tutorial-deployment-strategy/package.png)
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)
7164

72-
## Other deployment strategies
65+
## Related articles
7366

7467
- [Configure the rolling deployment strategy](./tutorial-devops-azure-pipelines-classic.md)
7568
- [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

Comments
 (0)