Azure DevOps self-hosted agent using prebuilt images

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:

  1. Use Terraform code to create an Azure Virtual Machine Scale Set.
  2. 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

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:

Azure DevOps self-hosted agent using prebuilt images

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.

Azure DevOps self-hosted agent using prebuilt images

Next:

Azure DevOps self-hosted agent using prebuilt images

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!

Leave a Reply

Your email address will not be published. Required fields are marked *