You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Tutorial - Configure canary deployments for Azure Linux Virtual Machines
3
-
description: In this tutorial you will learn how to set up continuous deployment (CD) pipeline that updates a group of Azure virtual machines using the blue-green deployment strategy
2
+
title: Tutorial - Configure canary deployments for Azure Linux virtual machines
3
+
description: In this tutorial, you 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.
4
4
author: moala
5
5
manager: jpconnock
6
6
tags: azure-devops-pipelines
@@ -14,65 +14,77 @@ ms.date: 4/10/2020
14
14
ms.author: moala
15
15
ms.custom: devops
16
16
17
-
#Customer intent: As a developer, I want to learn about CI/CD features in Azure so that I can use devops services like Azure Pipelines to build and deploy my applications automatically.
17
+
#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.
18
18
---
19
19
20
-
# Tutorial - Configure Blue-Green deployment strategy for Azure Linux Virtual Machines
20
+
# Tutorial - Configure the blue-green deployment strategy for Azure Linux virtual machines
21
21
22
+
## Infrastructure as a service (IaaS) - Configure CI/CD
22
23
23
-
## IaaS - Configure CI/CD
24
-
Azure Pipelines provides a complete, fully featured set of CI/CD automation tools for deployments to virtual machines. You can configure a continuous delivery pipeline for an Azure VM directly from the Azure portal. This document contains the steps associated with setting up a CI/CD pipeline that uses the blue-green strategy for multi-machine deployments. You can also take a look at other strategies like [rolling](https://aka.ms/AA7jlh8) and [canary](https://aka.ms/AA7jdrz), which are supported out-of-box from Azure portal.
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.
25
25
26
-
27
-
**Configure CI/CD on Virtual Machines**
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](https://aka.ms/AA7jlh8) and [canary](https://aka.ms/AA7jdrz).
28
27
29
-
Virtual machines can be added as targets to a [deployment group](https://docs.microsoft.com/azure/devops/pipelines/release/deployment-groups) and can be targeted for multi-machine updates. Once deployed, viewing **Deployment History** within a deployment group provides traceability from VM to the pipeline and then to the commit.
30
-
31
-
32
-
**Blue-Green Deployments**: A Blue-Green deployment reduces downtime by having an identical standby environment. At any time one of the environments is live. As you prepare for a new release, you complete final stage of testing in the green environment. Once the software is working in the green environment, switch the traffic so that all incoming requests go to the green environment - the blue environment is now idle.
33
-
You can configure Blue-Green deployments to your “**virtual machines**” from the Azure portal using the continuous delivery option.
28
+
### Configure CI/CD on virtual machines
34
29
35
-
Here is the step-by-step walkthrough.
30
+
You can add virtual machines as targets to a [deployment group](https://docs.microsoft.com/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.
36
31
37
-
1. Sign in to your Azure portal and navigate to a virtual machine
38
-
2. In the VM left pane, go **Continuous delivery**. Then click **Configure**.
3. In the configuration panel, click **Azure DevOps Organization** to select an existing account or create one. Then select the project under which you would like to configure the pipeline.
34
+
A blue-green deployment reduces downtime by having an identical standby environment. Only one environment is live at any time.
42
35
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.
4. A deployment group is a logical set of deployment target machines that represent the physical environments; for example, "Dev", "Test", "UAT", and "Production". You can create a new deployment group or select an existing deployment group.
46
-
5. Select the build pipeline that publishes the package to be deployed to the virtual machine. Note that the published package should have a deployment script _deploy.ps1_ or _deploy.sh_ in `deployscripts` folder at the package root. This deployment script will be executed by Azure DevOps pipeline at run time.
47
-
6. Select the deployment strategy of your choice. Select **Blue-Green**.
48
-
7. Add a "blue" or "green" tag to the VMs that are to be part of Blue-Green deployments. If the VM is for a standby role, then you should tag it as "green", otherwise tag it as "blue".
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:
50
39
51
-
8. Click **OK** to configure the continuous delivery pipeline. You will now have a continuous delivery pipeline configured to deploy to the virtual machine.
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**.
53
42
43
+

54
44
55
-
9. Click on **Edit** release pipeline in Azure DevOps to see the pipeline configuration. The pipeline consists of three phases. The first phase is a deployment group phase and deploys to VMs that are tagged as _green_ (standby VMs). The second phase pauses the pipeline and waits for manual intervention to resume the run. Once a user is satisfied that deployment is stable, they can now redirect the traffic to _green_ VMs and resume the pipeline run which will then swap _blue_ and _green_ tags in the VMs. This makes sure that the VMs that have older application version are tagged as _green_ and are deployed to in the next pipeline run.
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.
10. The Execute Deploy Script task will by default execute the deployment script _deploy.ps1_ or _deploy.sh_ in the `deployscripts` folder at the root directory of published package. Make sure that the selected build pipeline publishes this in the root folder of package.
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".
61
53
54
+

62
55
56
+
1. Select **OK** to configure the continuous-delivery pipeline to deploy to the virtual machine.
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:
61
+
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.
65
+
66
+

67
+
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.
69
+
70
+

64
71
65
72
## Other deployment strategies
66
-
-[Configure Rolling Deployment Strategy](https://aka.ms/AA7jlh8)
With DevOps Projects, start running your application on any Azure service in just three steps: select an application language, a runtime, and an Azure service.
-[Deploy to Azure Virtual Machines using DevOps project](https://docs.microsoft.com/azure/devops-project/azure-devops-project-vms)
78
-
-[Implement continuous deployment of your app to an Azure Virtual Machine Scale Set](https://docs.microsoft.com/azure/devops/pipelines/apps/cd/azure/deploy-azure-scaleset)
73
+
74
+
-[Configure the rolling deployment strategy](https://aka.ms/AA7jlh8)
75
+
-[Configure the canary deployment strategy](https://aka.ms/AA7jdrz)
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:
-[Deploy to Azure virtual machines by using Azure DevOps Projects](https://docs.microsoft.com/azure/devops-project/azure-devops-project-vms)
90
+
-[Implement continuous deployment of your app to an Azure virtual machine scale set](https://docs.microsoft.com/azure/devops/pipelines/apps/cd/azure/deploy-azure-scaleset)
0 commit comments