This document provides instructions for a hands-on lab on using Azure DevOps deployment groups. It describes how deployment groups can be used to deploy an application to multiple servers in a sequenced manner. The steps show how to set up target Azure virtual machines, configure the necessary service connections in Azure DevOps, create deployment groups, and configure a release pipeline to deploy to the deployment groups. Prerequisites for the lab are also provided.
2. Hands On Lab
Azure DevOps Deployment Group
Synopsis
In this hands-on lab, you will learn how to deploy an application to multiple servers. The Windows PowerShell
remoting had to be enabled manually, the required ports opened, and the deployment agent installed on each
of the servers. The pipeline had to be managed manually if a roll-out deployment was required.
All of above challenges have been handled seamlessly with the introduction of the Deployment Groups.
The Deployment Group installs a deployment agent on each of the target servers in the configured group and
instruct the Release Pipeline to gradually deploy the application to all these servers that belong to the
Deployment Group. Multiple pipeline can be created for the roll-out deployments so that the latest version of
the application could be provided in a phased manner to the multiple user groups for validating the newly
introduced features.
3. Hands On Lab
Azure DevOps Deployment Group
Prerequisites
1. Microsoft Azure Account – you will need a valid and active Azure account. If you do not have one, please
sign up for a free trial here (https://azure.microsoft.com/en-us/free/)
2. Azure DevOps account – you will need a valid and active Azure DevOps account. If you do not have one,
please sign up for free here (https://azure.microsoft.com/en-us/services/devops/ )
3. Sample Azure DevOps Project – use Azure DevOps Demo generator to create team project on your Azure
DevOps Organization with sample content that include source code, work items, iterations, service
endpoints, build and release definition. Click here
(https://azuredevopsdemogenerator.azurewebsites.net/?TemplateId=77368&Name=deploymentgroups )
to provision sample project.
4. What is Deployment Group
• Deployment group is a logical set of deployment target machines that have agents installed on each one.
Deployment groups represent the physical environments; for example “Dev”, “Test”, “UAT” and “Production”
Web Server
SQL Server
Web Server
SQL Server
RELEASE
package
RELEASE pipelines (DEV) RELEASE pipelines (PROD)
DEV deployment group PROD deployment group
A deployment agent must be installed in each machine
5. How to install deployment agent?
Manually run script in each machine
Install Azure Pipelines Agent Azure VM extension in each machine
Use Azure Resource Group Deployment task in release pipeline
6. Hands On Lab
Azure DevOps Deployment Group
Step – 1 Ensure all prerequsites are met
1. Microsoft Azure Account – you will need a valid and active Azure account. If you do not have one, please
sign up for a free trial here (https://azure.microsoft.com/en-us/free/)
2. Azure DevOps account – you will need a valid and active Azure DevOps account. If you do not have one,
please sign up for free here (https://azure.microsoft.com/en-us/services/devops/ )
3. Sample Azure DevOps Project – use Azure DevOps Demo generator to create team project on your Azure
DevOps Organization with sample content that include source code, work items, iterations, service
endpoints, build and release definition. Click here
(https://azuredevopsdemogenerator.azurewebsites.net/?TemplateId=77368&Name=deploymentgroups )
to provision sample project.
Template : DeploymentGroups
7. Hands On Lab
Azure DevOps Deployment Group
Step – 2 Create target machines for deployment group target
1. In this step following resources will be provisioned on Azure using an ARM template:
• 6 virtual machines (VM) web servers with IIS configured
• 1 virtual machine (VM) SQL server
• 1 azure network load balancer
2. Launch following URL
(https://portal.azure.com/#create/Microsoft.Template/uri/http%3A%2F%2
Fbit.ly%2Fgab2019-tmpl )
http%3A%2F%2Fbit.ly%2Fgab2019-tmpl http://bit.ly/gab2019-tmpl
https://bit.ly/2PyzXPU
8. Hands On Lab
Azure DevOps Deployment Group
Step – 2 Create target machines for deployment group target
1. In this step following resources will be provisioined on Azure using
an ARM template:
• 6 virtual machines (VM) web servers with IIS configured
• 1 virtual machine (VM) SQL server
• 1 azure network load balancer
2. Launch following URL
(https://portal.azure.com/#create/Microsoft.Template/uri/http%3A
%2F%2Fbit.ly%2Fgab2019-tmpl )
3. Complete the custom deployment settings, create GAB2019
resource group
4. Notes the settings for the rest of HOL.
5. Notes DNS name of SQL server and Web Server after resources
creation
(https://portal.azure.com/#create/Microsoft.Template/uri/
http%3A%2F%2Fbit.ly%2Fgab2019-tmpl )
9. Hands On Lab
Azure DevOps Deployment Group
Step – 3 Add Azure Resource Manager service connection
1. In AzureDevOps – click Project Settings -> Pipelines -> Service
Connections
2. Click “New service connection” -> Azure Resource Manager
3. On “Add an Azure Resource Manager service connection” dialog,
select Service Principal Authentication.
4. Select from available Subscription
5. Type Connection name and click OK.
10. Hands On Lab
Azure DevOps Deployment Group
Step – 4 Create Personal Access Token in AzureDevOps
1. In profile name, select “Security”
11. Hands On Lab
Azure DevOps Deployment Group
Step – 4 Create Personal Access Token in AzureDevOps
1. In profile name, select “Security”
2. In Personal Access Token page, click New
3. Type Name, select Organization, and expiration.
4. Select following scopes:
• Work Items – Read & Write
• Code – Read
• Build – Read & Execute
• Release – Read, write , execute & manage
• Test Management – Read & write
• Deployment Groups – Read & manage
Click “Show all scopes” if you can not see the scope in dialog.
5. Important, keep PAT token in secure place until we
complete this HOL.
12. Hands On Lab
Azure DevOps Deployment Group
Step – 4 Add Azure Repos/Team Foundation Server service connection
1. In AzureDevOps – click Project Settings -> Pipelines -> Service
Connections
2. Click “New service connection” -> Azure Repos/Team Foundation
Server
3. On “Add Azure Repos/Team Foundation service connection” dialog,
select Token Based Authentication.
4. On Connection URL, type Azure Repos/Team Foundation server url
from Step-1.
5. Type Connection name and click OK.
6. Type PAT from Step-4 and click Verify connection.
7. Click OK
13. Hands On Lab
Azure DevOps Deployment Group
Step – 5 Create Deployment Groups
1. In AzureDevOps – click Pipelines -> Deployment groups
2. Click Add a deployment group
3. Type the name
14. Hands On Lab
Azure DevOps Deployment Group
Step – 6 Configure Release pipeline
1. In AzureDevOps – click Pipelines -> Releases
2. Click Edit
15. Hands On Lab
Azure DevOps Deployment Group
Step – 6 Configure Release pipeline
1. In AzureDevOps – click Pipelines -> Releases
2. Click Edit
3. On edit pipeline, click Task -> Dev
16. Hands On Lab
Azure DevOps Deployment Group
Step – 6 Configure Release pipeline
1. In AzureDevOps – click Pipelines -> Releases
2. Click Edit
3. On edit pipeline, click Task -> Dev
4. Modify task what requires settings attention (use
information from previous steps)
17. Hands On Lab
Azure DevOps Deployment Group
Step – 6 Configure Release pipeline
1. In AzureDevOps – click Pipelines -> Releases
2. Click Edit
3. On edit pipeline, click Task -> Dev
4. Modify task what requires settings attention (use
information from previous steps)
5. Click Variables, and modify
DefaultConnectionString with the SQL DNS
6. Save and create new Release.