Edit

Share via


Use deployment groups in Classic release pipelines

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

Similar to an agent pool, a deployment group is a logical set of target machines, each have a deployment agent installed. Deployment groups typically represent environments such as *Development, Test, or Production. Each physical or virtual machine in the deployment group communicates with Azure Pipelines to coordinate deployment tasks. Deployment groups differ from deployment jobs, which are collections of task-related steps defined in YAML pipelines.

Deployment groups give you a flexible way to manage and monitor your deployment targets. You can define the security context and runtime environment for agents, assign roles and permissions to team members, and get real-time visibility into deployments with live logs for each server. You can also use tags to target specific machines, making deployments more precise and efficient.

Note

Deployment groups are only available in Classic release pipelines.

Prerequisites

Product Requirements
Azure DevOps - An Azure DevOps organization.
- An Azure DevOps project.
- Administrator permissions on a Windows or Linux machine to install and configure the deployment agent.

Create a deployment group

  1. Sign in to your Azure DevOps organization, and navigate to your project.

  2. In your project, select Pipelines, then select Deployment groups.

  3. On the Deployment groups page, select New. If this is your first deployment group, select Add a deployment group.

  4. Enter a Deployment group name and then select Create.

  5. On the next screen, select Windows or Linux for the Type of target to register. A registration script is generated.

  6. Select Use a personal access token in the script for authentication, then select Copy script to the clipboard.

  7. Save the copied script to run on all the target machines in your deployment group.

    A screenshot displaying how to create a deployment group in Azure Pipelines.

Register target servers

To register each target server in the deployment group:

  1. Sign in to the machine using an account with administrator permissions, and run the copied script. For Windows machines, use an elevated PowerShell command prompt.

  2. When prompted to add tags (can be used to target deployments to specific servers in a deployment group job), enter Y, then provide one or more tags. Tags are case insensitive, limited to 256 characters each, and there's no limit to the number of tags you can use.

  3. Once setup is complete, the script should return the following message:

    Service vstsagent.{organization-name}.{computer-name} started successfully.
    

Install and upgrade agents

Every target server in the deployment group requires a deployment agent. The generated registration script for target servers installs an agent. Alternatively, you can install agents using one of the following methods:

See Provision agents for deployment groups for more details.

To upgrade deployment agents to the latest version without redeploying, go to the Deployment groups page, select the More actions ellipsis next to your deployment group, and choose Update targets. See Agents for more details.

A screenshot showing how to update targets in deployment groups.

Deployment pools

A deployment pool is a collection of target servers available across your entire Azure DevOps organization. To create or manage deployment pools, you must have Project Collection Administrator permissions.

When you create a new deployment pool, you can automatically provision corresponding deployment groups in selected projects or across all projects in the organization. These deployment groups share the same target servers as the deployment pool.

To upgrade the agent version on all servers in a deployment pool, go to Deployment pools, select the More actions ellipsis next to the pool, and choose Update targets.

A screenshot displaying how to update targets in deployment pools.

Share deployment groups

You can share deployment groups with other projects in your Azure DevOps organization. To make a deployment group available to other projects:

  1. Sign in to your Azure DevOps organization, and navigate to your project.

  2. Select Pipelines > Deployment groups. Select your deployment group and then select Manage.

    A screenshot displaying the details page of a deployment group.

  3. In the list of projects, select the ones you want to share the deployment group with, and then select Save.

    A screenshot displaying how to share with other projects.

  4. After saving, the selected projects will see the shared deployment group listed under Deployment groups.

    A screenshot showing a shared new deployment group.

Automatically deploy to new target servers

You can configure your environment to automatically deploy the last successful release when new target servers are added to a deployment group:

  1. Sign in to your Azure DevOps organization, and navigate to your project.

  2. Select Pipelines > Releases, then select your release pipeline.

  3. Select the post deployment icon to open the Post-deployment conditions screen, and enable the Auto redeploy trigger.

  4. Under Select events, select New target with required tags becomes available.

  5. Under Select action, select Redeploy the last successful deployment on this environment.

    A screenshot displaying how to enable the Auto redeploy trigger.