Azure DevOps agents ...

August 15, 2023

In the previous articles, we learned that the Azure DevOps pipelines can be used to build and deploy

A job is a building block of a pipeline and is a collection of steps

To run a job, we require some infrastructure and the infrastructure is called the agent

In this article, we will learn about the agent

Azure DevOps Agent:

To build or release an application we will need at least one agent. Based on the scale of the project, we might need more agents

when a pipeline is executed, a job will begin to run in the agent

Azure DevOps Agent types:

Based on the ownership of the agent infrastructure, there are two major categories of Azure DevOps agents

  • Microsoft-hosted agents
  • Self-hosted agents

Microsoft hosted agent:

Microsoft provides agents with a predefined set of tools, upgrades and maintenance of these agents are taken care of by Microsoft

whenever we try to run a pipeline, behind the scenes - a fresh virtual machine will be created and allocated to run a job and discarded after a job completion

This also means that the changes done on the VM filesystem by the job will not be persistent

Microsoft-hosted agents are the simplest way to run the pipeline as the maintenance is taken care of.

Self-hosted agent:

In case the application requires a variety of dependent software to build and release or we need machine-level cache or persistence across pipeline runs - A self-hosted agent is an option.

self-hosted agents provided us complete control over the infra and the dependent software.

Following variants of the Agents exist based on the infrastructure in which they are installed

  • MacOS agent
  • Linux agent
  • Windows agent
  • Docker agent

Azure DevOps Agent Pool:

An agent pool represents a collection of agents. An agent is scoped at an Organization level so a pool can be shared across multiple projects.

Each pipeline will be targeted to an agent pool and Azure DevOps determines which agent has to be allocated from a pool to run a specific job.

A predefined agent pool called "Azure Pipelines" is provided with Microsoft-hosted agents.

another predefined pool called "Default" is provided where self-hosted agents can be included.

Azure DevOps Agent Specifications:

Azure DevOps agents have the following two major specifications

  • Capabilities
  • Parallel jobs

Capabilities:

Azure DevOps agents can possess certain capabilities which define what they can do, for example -

demand from a job can be that the agent should have the capability to run Maven

demand from a job and capabilities of an agent should have an exact match

Parallel jobs:

Parallel jobs define the number of pipeline jobs that can run simultaneously in an Azure DevOps organization

If there is only one parallel job - the second and further run of the jobs will have to wait in a queue until the first job is completed

depending on the concurrency required, we might need to purchase additional parallel jobs

Parallel jobs can be used with Microsoft-hosted or self-hosted agents

for Microsoft-hosted parallel jobs - we can get up to 10 free parallel jobs that can run upto 6 hours each time in the case of public projects

for private projects, we can get a free job that can run upto 60 mins each time (with 30 hours monthly cap)

Summary:

azure devops agent summary

We saw an overview of Azure DevOps agents and their types , in the next week - we will see a bit more in detail.


Profile picture

Written by Thillai Madhavan who lives and works in India. Stay updated by following him on LinkedIn.

All the information on this website - OrganicDevops.com - is published in good faith and for general information purposes only. OrganicDevops.com does not make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find on this website (OrganicDevops.com), is strictly at your own risk. OrganicDevops.com will not be liable for any losses and/or damages in connection with the use of our website. From our website, you can visit other websites by following hyperlinks to such external sites. While we strive to provide only quality links to useful and ethical websites, we have no control over the content and nature of these sites. These links to other websites do not imply a recommendation for all the content found on these sites. Site owners and content may change without notice and may occur before we have the opportunity to remove a link that may have gone 'bad'. Please be also aware that when you leave our website, other sites may have different privacy policies and terms which are beyond our control. Please be sure to check the Privacy Policies of these sites as well as their "Terms of Service" before engaging in any business or uploading any information. By using our website, you hereby consent to our disclaimer and agree to its terms. Should we update, amend or make any changes to this document, those changes will be prominently posted here
© 2024, OrganicDevOps