VM Extension for Agent registration to YML Environments

Mike Hardman 20 Reputation points
2026-06-10T10:11:58.83+00:00

Hi,

We are migrating our pipelines from classic to YML style. As part of this we will need to move our VM agents from Deployment groups to Environments. Previously we used a VM extension (Microsoft.VisualStudio.Services.TeamServicesAgent) to automatically handle deployment group registration. Is there an equivalent extension for the newer style environments?

Regards

Mike

Azure DevOps
0 comments No comments

Answer accepted by question author

AI answer

2026-06-10T10:12:09.2733333+00:00

There is no separate Azure VM extension for registering agents to Azure Pipelines Environments (virtual machine resources) like the Microsoft.VisualStudio.Services.TeamServicesAgent extension used for classic Deployment Groups.

For YAML Environments with VM resources, registration is done by running the environment’s agent registration script on each machine:

  1. In Azure DevOps, go to Pipelines > Environments and create a new environment.
  2. Choose Virtual machines as the resource type and select the OS (Windows or Linux).
  3. Copy the generated registration script (PowerShell for Windows, shell script for Linux).
  4. Run this script on each target VM to install and register the agent with the environment.
    • The script uses a PAT embedded at generation time (valid for ~3 hours) and is the same for all VMs of that OS in the environment.
  5. After registration, the VMs appear under the environment’s Resources tab.

If automation is required (similar to how the VM extension worked for Deployment Groups), it must be implemented by invoking these scripts (or the underlying self-hosted agent install/config commands) through custom provisioning logic rather than via a dedicated Azure VM extension.

For classic Deployment Groups, the Azure Pipelines Agent VM extension remains available, but it only targets Deployment Groups, not YAML Environments.


References:

AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.