Use deployment groups in a release pipeline - Azure Pipelines (2024)

  • Article

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

A 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", or "Production" environment. In effect, a deployment group is just another grouping of agents, much like an agent pool.

Deployment groups are only available with Classic release pipelines and are different from deployment jobs. A deployment job is a collection of deployment-related steps defined in a YAML file to accomplish a specific task.

With deployment groups you can:

  • Specify the security context and runtime targets for the agents. As you create a deployment group, you add users and give them appropriate permissions to administer, manage, view, and use the group.

  • Let you view live logs for each server as a deployment takes place, and download logs for all servers to track your deployments down to individual machines.

  • Enable you to use machine tags to limit deployment to specific sets of target servers.

Create a deployment group

A deployment group is a set of virtual machines with deployment agents. Every VM of the deployment group interacts with Azure Pipelines to coordinate the deployment tasks.

  1. From within your project, select Pipelines > Deployment groups.

    Use deployment groups in a release pipeline - Azure Pipelines (1)

  2. Select Add a deployment group.

    Use deployment groups in a release pipeline - Azure Pipelines (2)

  3. Enter a Deployment group name and then select Create. A registration script will be generated. Select the Type of target to register and then select Use a personal access token in the script for authentication. Finally, select Copy script to the clipboard.

    Use deployment groups in a release pipeline - Azure Pipelines (3)

  4. Log onto each of your target machines and run the script from an elevated PowerShell command prompt to register it as a target server. When prompted to enter tags for your agent, press Y and enter the tag(s) you will use to filter subsets of the servers.

    Use deployment groups in a release pipeline - Azure Pipelines (4)

After setting up your target servers, the script should return the following message: Service vstsagent.{organization-name}.{computer-name} started successfully.

The tags you assign to your target servers allow you to limit deployment to specific servers in a Deployment group job.A tag is limited to 256 characters, but there is no limit to the number of tags you can use.

Note

A deployment pool is a set of target servers available to the organization (org-scoped). When you create a new deployment pool for projects in your organization, a corresponding deployment group is automatically provisioned for each project. The deployment groups will have the same target servers as the deployment pool. You can manually trigger an agent version upgrade for your target servers by hovering over the ellipsis (...) in Deployment Pools and selecting Update targets. See Agent versions and upgrades for more details.

Use deployment groups in a release pipeline - Azure Pipelines (5)

Set up agents on deployment groups

Every target server in the deployment group requires a deployment agent. You can install an agent on your target servers in three different ways:

  • By running the generated script from the Deployment Groups tab.

  • If the target servers are Azure VMs, you can easily set up your servers by installing the Azure Pipelines Agent extension on each of the VMs.

  • By using the ARM template deployment task in your release pipeline to create a deployment group dynamically.

You can force the agents on the target servers to be upgraded to the latest version without needing to redeploy them by selecting Update targets from your deployment groups page.

Use deployment groups in a release pipeline - Azure Pipelines (6)

Monitor release status for deployment groups

When a release pipeline is executing, you can view the live logs for each target server in your deployment group. When the deployment is completed, you can download the log files for every server to examine the deployments and debug any issues.

Use deployment groups in a release pipeline - Azure Pipelines (7)

Deployment groups can be shared with other projects in the same organization. Follow the steps below to provision your deployment group for other projects:

  1. From within your project, select Pipelines > Deployment groups.

  2. Select your deployment group and then select Manage.

    Use deployment groups in a release pipeline - Azure Pipelines (8)

  3. Select a project from the list and then select Save.

    Use deployment groups in a release pipeline - Azure Pipelines (9)

  4. You will now notice that there is a new Deployment Group in the project you just included.

    Use deployment groups in a release pipeline - Azure Pipelines (10)

Automatically deploy to new target servers

When new target servers get added to a deployment group, you can configure the environment to automatically deploy the last successful release to the new targets.

From your release pipeline definition, select the post deployment icon, and then enable the Auto redeploy trigger. Select the events and action as shown below.

Use deployment groups in a release pipeline - Azure Pipelines (11)

Related articles

  • Deployment group jobs
  • Deploy to Azure VMs using deployment groups
  • Provision agents for deployment groups
  • Self-hosted Windows agents
  • Self-hosted macOS agents
  • Self-hosted Linux agents
Use deployment groups in a release pipeline - Azure Pipelines (2024)
Top Articles
Latest Posts
Article information

Author: Msgr. Benton Quitzon

Last Updated:

Views: 6078

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Msgr. Benton Quitzon

Birthday: 2001-08-13

Address: 96487 Kris Cliff, Teresiafurt, WI 95201

Phone: +9418513585781

Job: Senior Designer

Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.