Skip to content

Commit 4208edb

Browse files
authored
Merge pull request #111758 from raiyanalam/master
Update for separate Rolling, Canary and Blue Green deployment strategies
2 parents e2f8dcb + acfc96b commit 4208edb

File tree

6 files changed

+180
-62
lines changed

6 files changed

+180
-62
lines changed
56 KB
Loading
Loading

articles/virtual-machines/linux/toc.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@
4545
href: ../../jenkins/tutorial-jenkins-github-docker-cicd.md
4646
- name: 14b - Integrate Jenkins with Azure DevOps
4747
href: ../../jenkins/tutorial-build-deploy-jenkins.md
48-
- name: 15a - DevOps for IaaS and PaaS on Azure
48+
- name: 15a - Configure Rolling deployment strategy
4949
href: tutorial-devops-azure-pipelines-classic.md
50-
- name: 15b - CI/CD with Azure Pipelines(YAML)
50+
- name: 15b - Configure Canary deployment strategy
51+
href: tutorial-azure-devops-canary-strategy.md
52+
- name: 15c - Configure Blue-Green deployment strategy
53+
href: tutorial-azure-devops-blue-green-strategy.md
54+
- name: 15d - CI/CD with Azure Pipelines(YAML)
5155
href: tutorial-build-deploy-azure-pipelines.md
5256
- name: 16a - Create LAMP stack
5357
href: tutorial-lamp-stack.md
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
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
4+
author: moala
5+
manager: jpconnock
6+
tags: azure-devops-pipelines
7+
8+
ms.assetid:
9+
ms.service: virtual-machines-linux
10+
ms.topic: tutorial
11+
ms.tgt_pltfrm: azure-pipelines
12+
ms.workload: infrastructure
13+
ms.date: 4/10/2020
14+
ms.author: moala
15+
ms.custom: devops
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.
18+
---
19+
20+
# Tutorial - Configure Blue-Green deployment strategy for Azure Linux Virtual Machines
21+
22+
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.
25+
26+
27+
**Configure CI/CD on Virtual Machines**
28+
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.
34+
35+
Here is the step-by-step walkthrough.
36+
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**.
39+
40+
![AzDevOps_configure](media/tutorial-devops-azure-pipelines-classic/azure-devops-configure.png)
41+
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.
42+
43+
44+
![AzDevOps_project](media/tutorial-devops-azure-pipelines-classic/azure-devops-rolling.png)
45+
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".
49+
![AzDevOps_bluegreen_configure](media/tutorial-devops-azure-pipelines-classic/azure-devops-blue-green-configure.png)
50+
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.
52+
![AzDevOps_bluegreen_pipeline](media/tutorial-devops-azure-pipelines-classic/azure-devops-blue-green-pipeline.png)
53+
54+
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.
56+
![AzDevOps_bluegreen_task](media/tutorial-devops-azure-pipelines-classic/azure-devops-blue-green-tasks.png)
57+
58+
59+
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.
60+
![AzDevOps_publish_package](media/tutorial-deployment-strategy/package.png)
61+
62+
63+
64+
65+
## Other deployment strategies
66+
- [Configure Rolling Deployment Strategy](https://aka.ms/AA7jlh8)
67+
- [Configure Canary Deployment Strategy](https://aka.ms/AA7jdrz)
68+
69+
## Azure DevOps project
70+
Get started with Azure more easily than ever.
71+
72+
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.
73+
74+
[Learn more](https://azure.microsoft.com/features/devops-projects/ ).
75+
76+
## Additional resources
77+
- [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)
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
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 Linux Virtual Machines using canary deployment strategy
4+
author: moala
5+
manager: jpconnock
6+
tags: azure-devops-pipelines
7+
8+
ms.assetid:
9+
ms.service: virtual-machines-linux
10+
ms.topic: tutorial
11+
ms.tgt_pltfrm: azure-pipelines
12+
ms.workload: infrastructure
13+
ms.date: 4/10/2020
14+
ms.author: moala
15+
ms.custom: devops
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.
18+
---
19+
20+
# Tutorial - Configure Canary deployment strategy for Azure Linux Virtual Machines
21+
22+
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 Azure portal. This document contains the steps associated with setting up a CI/CD pipeline that uses the Canary strategy for multi-machine deployments. You can also take a look at other strategies like [rolling](https://aka.ms/AA7jlh8) and [blue-green](https://aka.ms/AA83fwu), which are supported out-of-box from Azure portal.
25+
26+
27+
**Configure CI/CD on Virtual Machines**
28+
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, the **Deployment History** within your deployment group provides traceability from VM to the pipeline and then to the commit.
30+
31+
32+
**Canary Deployments**: A canary deployment reduces risk by slowly rolling out the change to a small subset of users. As you gain more confidence in the new version, you can start releasing it to more servers in your infrastructure and routing more users to it.
33+
You can configure canary deployments to your virtual machines with the Azure portal using continuous delivery option.
34+
Here is the step-by-step walkthrough.
35+
1. Sign in to your Azure portal and navigate to a virtual machine
36+
2. In the VM left pane, navigate to the **Continuous delivery** menu. Click **Configure**.
37+
38+
![AzDevOps_configure](media/tutorial-devops-azure-pipelines-classic/azure-devops-configure.png)
39+
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.
40+
41+
42+
![AzDevOps_project](media/tutorial-devops-azure-pipelines-classic/azure-devops-rolling.png)
43+
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.
44+
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 the `deployscripts` folder at the package root. This deployment script will be executed by the Azure DevOps pipeline at run time.
45+
6. Select the deployment strategy of your choice. Select **Canary**.
46+
7. Add a 'canary' tag to the VMs that are to be part of canary deployments and a 'prod' tag to the VMs that are part of deployments after canary deployment in successful. Tags help you target VMs that have specific role only.
47+
![AzDevOps_configure_canary](media/tutorial-devops-azure-pipelines-classic/azure-devops-configure-canary.png)
48+
49+
8. Click **OK** on the dialog to configure the continuous delivery pipeline. You will now have a continuous delivery pipeline configured to deploy to the virtual machine.
50+
![AzDevOps_canary_pipeline](media/tutorial-devops-azure-pipelines-classic/azure-devops-canary-pipeline.png)
51+
52+
53+
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 _canary_. The second phase, pauses the pipeline and waits for manual intervention to resume the run. Once a user is satisfied that canary deployment is stable, they can resume the pipeline run which will then run the third phase that deploys to VMs tagged as _prod_.
54+
![AzDevOps_canary_task](media/tutorial-devops-azure-pipelines-classic/azure-devops-canary-task.png)
55+
56+
10. Before resuming the pipeline run, make sure that at least one VM is tagged as _prod_. In the third phase of the pipeline, the application will be deployed to only those VMs that have _prod_ tag.
57+
58+
11. The Execute Deploy Script task will by default execute the deployment script _deploy.ps1_ or _deploy.sh_ in 'deployscripts' folder at the root directory of published package. Make sure that the selected build pipeline publishes this in the root folder of package.
59+
![AzDevOps_publish_package](media/tutorial-deployment-strategy/package.png)
60+
61+
62+
63+
64+
## Other deployment strategies
65+
- [Configure Rolling Deployment Strategy](https://aka.ms/AA7jlh8)
66+
- [Configure Blue-Green Deployment Strategy](https://aka.ms/AA83fwu)
67+
68+
## Azure DevOps project
69+
Get started with Azure more easily than ever.
70+
71+
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.
72+
73+
[Learn more](https://azure.microsoft.com/features/devops-projects/ ).
74+
75+
## Additional resources
76+
- [Deploy to Azure Virtual Machines using DevOps project](https://docs.microsoft.com/azure/devops-project/azure-devops-project-vms)
77+
- [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

Comments
 (0)