Azure DevOps self-hosted agent using prebuilt images is the second article in the series. The whole solution is based on GitHub Actions runner images, which you can find on GitHub. In this article, you will get information on how you can obtain prebuilt images for an Azure Virtual Machine or Azure Virtual Machine Scale Set. This means you can create an Azure DevOps agent with all the necessary tools in minutes!
In GitHub, you can find my forked repository, actions-runner-images which contains definitions for images used as managed agents in Azure DevOps and GitHub Actions. Building these images takes hours, so I thought this initiative would be valuable.
Images versions and build status
I have built images:
- ubuntu 20.04
- ubuntu 22.04
- ubuntu 24.04
- Windows 2019
- Windows 2022
If a new version of the image is published, I try to make it available ASAP.
Images are stored in the Azure compute gallery, which has no restrictions and can be used by anyone. All builds are also public (check them here), allowing you to compare my repository with the original one. I do not make any changes to the definitions of the images. I’ve only added a Terraform wrapper for Packer execution and included new image versions in the Azure compute gallery.
To use my image, you have two choices:
- Use Terraform code to create an Azure Virtual Machine Scale Set.
- Create it manually from the portal.
If you would like more detailed instructions for the Azure DevOps self-hosted pool, you can access my tutorial here!
Azure DevOps self-hosted agent using prebuilt images – Terraform
My sincere apologies for this. Currently, Terraform doesn’t support public gallery images. I am in the middle of a conversation with Microsoft regarding this issue.
First, you need to clone my repository, which you can find here: https://github.com/karol-pieciukiewicz/azure-way/tree/main/13_ado_agent_pool_vmss_prebild_images/terraform.
After cloning, simply run ‘Terraform Apply’ and choose which image you would like to download. See the options below:
Of course, you must adjust the Virtual Network. Terraform will then prepare an Azure Virtual Machine Scale Set with the chosen image. By default, the latest image is selected. If you need to specify the version, you can do so by setting the community_image_version
parameter.
Azure DevOps self-hosted agent using prebuilt images – Azure portal
In the Azure Virtual Machine or Azure Virtual Machine Scale Set, you must select ‘Community images.’ Follow the instructions below.
Next:
Select an Ubuntu or Windows image, and proceed with the standard creation procedure.
Summary
With the prebuilt images, you can set up your self-hosted agent pool in minutes rather than hours. You obtain images identical to those used in Microsoft-hosted agents, so you likely won’t need to bother with installing any additional tools.
I will build new versions of the images as soon as they appear in the main repository. If you would like to receive information about new versions as they are released, follow me on LinkedIn! Cheers!
Hi, I’m using the ubuntu-24.04 image v 20240922.1.0 in an Azure scaleset for a DevOps agent pool.
The VMs will not start because the extension Microsoft.Azure.DevOps.Pipelines.Agent is an old version – 1.23 – it throws an error due to a python version mismatch I believe.
If I manually update it to 1.26, the VM will start and build runs.
I cannot see a way to make it update automatically, so I’m having to do it every time the pool scales up from 0.
I have had a look at the source for the image, but I cannot see where to change the version for this extension.
Are you able to help.
Hi Frank,
Thank you for letting me know. Just a moment ago, I updated the origin repo, and the images are building right now. Ubuntu 24.04 should be ready in about an hour.