Managed DevOps Pools (MDP) for Azure DevOps
When we use some Azure DevOps services, we need to have some agents to run our pipelines. These agents can be self-hosted or Microsoft-hosted. Both of them have pro/cont, Microsoft-hosted agents are managed by Microsoft, so we don’t need to care about the infrastructure and OS update but not support the VNet integration, so to reach any internal resources (Private endpoint as well) we need to use self-hosted agents. Until now that was a huge work to manage the self-hosted agents. Not just the infrastructure because mostly we use VMSS or containers, but the agents OS itself. We need to update the agents, softwares in image, we need to monitor the agents, etc.
We now have a new service called Managed DevOps Pools (MDP), currently in preview, which also supports Microsoft-hosted agent OS. This allows us to create a Microsoft-hosted agent in VNet-integrated mode. Additionally, we have the option to use a custom image if required.
Organization
First, we need to create an organization in Azure DevOps, if we don’t have one. This is a mandatory, because we will register the agent pool to this organization and in the creation we need to set the organization name.
So if you don’t have go to https://dev.azure.com and create one.
Managed DevOps Pool
After we have the organization, we can create the Managed DevOps Pool. So go to the Azure Portal and search for “Managed DevOps Pools” and click on the “Add” button.
Basics
- Dev Center: If we dont have, we have to create here one. The Dev Center is a resource where the MDP will be created. The name have to be unique, so the “pool” word is NOT a good idea :)
- The Organization name where we want to register the MDP and the agent pool name what we want to use.
- Maximum number of agents what we want to allow in the pool and the SKU (VM size).
- The image what we want, here we can pick the Microsoft-hosted image or a custom image and remove the default Ubuntu image as well.
So pick which image you want to use than add
Scaling
Here we can set the scaling options, so we can set the minimum and the standby agents as well.
Networking
Inject the VNet where we want to use the agents. This is required if we want to access the local endpoints, so we need to have a VNet where we want to use the agents. If we use Vnet integration, we should not to forget the FW rules as well, what documentation can be found here.
Security
Very important part, here we can set the security options, so who can use the agents. Because I would like to allow all of my project to use the agents, I will set the “Allow all projects” option, but later we have to set the permissions for the pipeline as well.
Review + Create
Se create the MDP and the agent pool, so we can start to use it.
Use the Managed DevOps Pool
This part is very easy, because we can use the MDP as a normal agent pool. So we can use it in the pipeline as a normal agent pool. In the pipeline we can set the pool name, so we can use the MDP as well, but as I mentioned before, we pick more than one image, so we can use based on this example:
Here is an example how we can use the MDP in the pipeline amd how we can use the custom image as well:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
trigger: none
stages:
- stage: Test
displayName: Test Image usage
jobs:
- job: ubuntu2024
pool:
name: gudszentpool
demands:
- ImageOverride -equals ubuntu-20.04
steps:
- script: |
lsb_release -a
apt list --installed
displayName: 'ubuntu-20.04'
- job: ubuntu2224
pool:
name: gudszentpool
demands:
- ImageOverride -equals ubuntu-22.04
steps:
- script: |
lsb_release -a
apt list --installed
displayName: 'ubuntu-22.04'
and the result:
Conclusion
The Managed DevOps Pool is a very good service, because we can use the Microsoft-hosted agents in VNet integrated mode, so we can reach the internal resources as well. We can use the custom image as well, so we can use the MDP as a normal agent pool as a managed services.
Links
https://devblogs.microsoft.com/devops/managed-devops-pools/
https://learn.microsoft.com/en-us/azure/devops/managed-devops-pools/?view=azure-devops