OfferTransform Your Career with Expert-Led IT Training. Flat discounts active!Explore Now
OnlineITGuru Logo
LIMITED PERIOD OFFER - FLAT 20% OFF
Cloud Computing & DevOps

Azure DevOps Build and Release Infrastructure Guide

Last updated on Nov 27, 2026

Copy Link:
Azure DevOps Build and Release Infrastructure Guide

Modern software engineering makes extensive use of continuous integration and continuous delivery pipelines to reliably compile source code, run automated tests, scan for security vulnerabilities, and deploy applications. These automated tasks are executed by the agent, which is the underlying compute engine in Azure DevOps. Azure Pipelines takes the queued work and assigns it to an available agent . When a developer pushes a commit or triggers a release, the agent processes the steps that have been defined, one at a time . One of the most consequential architectural decisions a DevOps or platform engineering team makes is how to provision, maintain and scale these agents.

Azure DevOps offers two main ways to host your pipelines: Microsoft-hosted agents and self-hosted agents. They both run the same pipeline definitions but are very different in terms of ownership, lifecycle management, performance characteristics, network isolation, security posture and total cost of ownership. Understanding how to manage both models, and when to mix them, allows engineering organisations to balance the velocity, governance, and infrastructure spend.

Microsoft-hosted agents: architecture and lifecycle

Microsoft-hosted agents are a fully-managed, serverless compute offering that runs on Microsoft cloud infrastructure. The default Azure Pipelines pool handles the underlying virtual machines, operating system patches, core SDKs, and agent software upgrades for you with Microsoft.

One of the defining characteristics of a Microsoft-hosted agent is its short-lived lifecycle. When you run a pipeline job, Azure DevOps grabs a brand new, clean virtual machine from a base image template – across recent versions of Ubuntu, Windows Server, and macOS. The job runs in this isolated environment and when the job is done, the entire virtual machine is discarded forever. There is nothing left on disc between pipeline runs.

This temporary architecture eliminates configuration drift, also known as the “works on my machine” syndrome at the build server level. Because each build starts from the same baseline image, teams don’t have to deal with stale temp files, corrupted local caches, or conflicting environment variables from a previous failed job. Microsoft also updates these images regularly with the latest runtimes, compilers, container engines, and cloud command-line utilities so that internal operations teams don’t have to worry about regular patching cycles.

Self-Hosted Agents Architecture and Lifecycle

Self-hosted agents flip the responsibility model on its head. Rather than using Microsoft’s throw-away virtual machines, you install the Azure Pipelines agent software on compute resources that you own, configure and control. These host machines can be from an on-premises data center, within an Azure private virtual network, within another public cloud provider, or even on dedicated physical hardware for special workloads like macOS mobile builds or GPU-accelerated machine learning compilation.

Microsoft-hosted agents are ephemeral, while traditional self-hosted agents are durable. The virtual machine or server remains active for multiple pipeline executions until you explicitly deallocate it. Working directories, downloaded package dependencies, container base layers, and compiled artefacts are persisted in the local storage volume between runs.

Azure DevOps can automatically update the light-weight agent binary itself when minor releases occur, but your team is fully responsible for the host operating system, security hardening, antivirus compliance, firewall rules and every compiler or tool installed on the machine. Self-hosted agents are also the only option for organisations running Azure DevOps Server on-premises because Microsoft-hosted pools are only available in the cloud-based Azure DevOps Services.

Finding the right balance among these approaches is a very important aspect of azure devops training, and ensuring that this is done through practice in a microsoft devops course will avoid many costly errors.

Performance, Hardware Customisation And Caching

The performance differences between the two hosting models usually come from the hardware specifications and from the state persistence. The Microsoft-hosted agents run on general purpose VMs with fixed CPU, memory, and disc allocations. This is a standard capacity good for standard microservices, lightweight web apps and standard unit tests. But big C++ or .NET solutions, complex container builds, and monolithic repositories can hit bottlenecks on standard hosted runners, especially around disc input/output operations and maximum job timeout limits.

Self-hosted agents avoid these hardware ceilings. Platform teams can spin up compute instances at high frequency, with lots of memory and ultra-fast solid-state storage, tuned precisely to the build workload. Raw hardware is even more impactful than persistent local caching. Every pipeline running on a Microsoft-hosted agent has to download gigabytes of NuGet, npm, Maven, or Python dependencies over the public internet, or restore them from remote pipeline caches, before any compilation even starts. Those package registries and Docker image layers stay warm on the local disc on a self-hosted agent, often cutting build durations by thirty to fifty percent.

The cost of persistent caching is workspace hygiene. Over time, the self-hosted agents accumulate gigabytes of stale build folders, orphaned Docker containers, and outdated package caches without any proper cleanup policies, leading to the root disc filling up and causing sudden pipeline failures. For self-hosted agents, you need scheduled maintenance jobs to prune unused container images, purge expired temporary workspaces, and proactively monitor disc utilisation.

Cloud architecture and pipeline management are crucial elements when working with custom build agents, and these aspects form an important part of any azure devops syllabus.

Network Connectivity and Private Resource Access

Networking is often the deciding factor for enterprise teams to adopt self-hosted agents. Microsoft-hosted agents run in shared, public cloud infrastructure and therefore connect to external endpoints over the public internet using a wide, rotating set of IP addresses. If you need to push database schema migrations to a private SQL server, deploy binaries to internal application servers behind a corporate firewall, or query a self-hosted artefact repository that cannot be reached from the public internet, a standard Microsoft-hosted agent cannot reach those targets without complex workarounds.

For most regulated industries, allowing traffic from the thousands of dynamic Microsoft datacenter IP ranges through corporate firewalls is a violation of security policy. Microsoft-hosted agents in the classic sense do not have native private network peering. Azure DevOps does offer Managed DevOps Pools, a more modern evolution that injects Microsoft-hosted virtual machines directly into your private Azure Virtual Network.

Self-hosted agents address private connectivity in a natural way. Since you deploy the agent inside your own virtual network or behind your corporate perimeter, it inherits your existing routing tables, private DNS resolution, and ExpressRoute or VPN tunnels. It can securely talk to internal Kubernetes clusters, private storage accounts and on-premises databases without exposing a single inbound port to the public internet. Additionally, the outbound traffic is from known, static IP addresses that security teams can easily allowlist.

Governance of Security, Compliance, and Isolation

Security in CI/CD pipelines is a trade off between convenience and blast-radius containment. Microsoft-hosted agents provide good tenant isolation at the compute layer, as each job gets its own dedicated virtual machine which is destroyed immediately after. Even if malicious code in a third party dependency attempts to compromise the build environment, that environment is gone minutes later, preventing lateral movement or persistent backdoors across subsequent builds.

Self-hosted agents introduce a different set of security risks that need careful governance. When you have multiple pipelines that share a persistent pool of self-hosted agents, one build can leak state into another. In theory, an attacker could inject malicious scripts into a shared cache or exfiltrate residual credentials from disc if a low-trust external contributor pull request build runs on the same persistent machine as a privileged production deployment pipeline.

To securely govern self-hosted agents, admins should enforce strict pool segmentation and identity hygiene. Production deployment agents should be isolated in their own agent pools with strict access control, allowing only approved release pipelines and authorised service connections to target them. Never run pipelines triggered by untrusted pull requests on persistent internal agents with privileged network access. Also, teams should authenticate agents using Microsoft Entra ID service principals, managed identities, and workload identity federation instead of storing static secrets or long-lived personal access tokens on the host machine.

Financial Optimisation and Cost Models

As an engineering organization scales, the financial structures of Microsoft-hosted and self-hosted agents are so vastly different. Pipelines are licensed in Azure DevOps mainly via parallel jobs. Parallel jobs define how many builds or deployments can run in parallel in your organization.

Microsoft-hosted agents include one free parallel job with Azure DevOps and provide up to 1,800 minutes each month for execution on private projects. Once a team goes over that threshold or needs to run builds in parallel so developers don't have to wait in queue, each additional Microsoft-hosted parallel job has a flat monthly fee associated with it that allows for unlimited execution minutes. That flat fee includes all the compute, storage and bandwidth costs, so customers know what they’re going to pay before they commit, and they don’t have to deal with the management hassle of cloud infrastructure billing.

Self-hosted agents are billed on a pro-rata billing model. Azure DevOps gives you one free self-hosted parallel job with unlimited minutes. Other parallel jobs are much cheaper per month than Microsoft-hosted ones. But that lower licence price does not include the underlying compute. Your organization pays separately for the virtual machines, attached storage discs, network egress, and engineering labour to keep those servers running.

Provisioning oversized virtual machines that sit idle overnight and over weekends can rapidly drive cloud compute bills higher than the cost of parallel jobs hosted by Microsoft. However, for large companies that run hundreds of pipelines concurrently 24x7, self-hosted agents can often save a significant amount, especially if combined with spot instances or reserved virtual machine pricing.

Scaling Strategies: Static Pools, Scale Sets and Managed DevOps Pools

Managing agent capacity is an ongoing balancing act between developer productivity and infrastructure waste. If you are short on agents during peak afternoon commit windows, developers are waiting in long queues, slowing down feedback loops. Over-provisioning static virtual machines for peak bursts means you pay for idle compute in quiet hours.

Static self-hosted agent pools are best for predictable, steady workloads or highly specialised hardware that cannot be spun up dynamically. But modern Azure DevOps environments are heavily reliant on elastic autoscaling to match supply to demand.

Azure Virtual Machine Scale Set agents provide an elastic in-between. In this setup, you create a custom virtual machine image with your tools, and then register a scale set with Azure Pipelines. Azure DevOps monitors the job queue and automatically increases the number of virtual machine instances if there are builds queuing up, and decreases the number to zero or a minimum standby number when the queue is empty. You can even configure these scale sets to tear down each VM after a single job, bringing together custom tooling and the clean-slate security of an ephemeral environment.

From this concept, Microsoft’s newer managed abstraction for customisable agents is Managed DevOps Pools. Managed DevOps Pools allow you to customise machine sizes, select custom images, inject agents directly into your private Azure Virtual Network, and choose between stateless single-use runners or stateful pools with configurable time-to-live limits, while Microsoft manages the underlying virtual machine lifecycle, automatic scaling, and security patching. This removes much of the custom scripting and maintenance burden historically associated with self-hosted scale sets.

Agent Pool Governance Best Practices

No matter what hosting model you prefer, disciplined management of your agent pool is the key to long-term reliability. Administrators should avoid indiscriminately dumping all projects into one big shared pool, but should group pools according to workload characteristics, operating system requirements, and security boundaries.

Capabilities and demands have a strong influence on job routing. Each agent automatically reports system capabilities, including installed SDK versions, operating system architecture, and environment variables. Administrators can also attach custom user capabilities to indicate specialised hardware or network access. By configuring pipelines to define exact requirements, Azure DevOps ensures it only schedules jobs on agents that meet those requirements, preventing the random build failures due to missing dependencies.

Using containerised jobs is another best practice that adds a lot of value in standardising environments in hosted and self-hosted pools. Rather than installing dozens of conflicting language runtimes directly on a host VM, teams can run lightweight host agents that contain only a container runtime. Then each pipeline specifies the exact docker container image it needs for its build step. This ensures a small underlying agent image, avoids version collisions between teams using different compiler releases, and enables developers to recreate the exact CI build environment locally on their laptops.

Lastly, continuous observability is a must for self-hosted infrastructure. Operations teams should monitor agent online status, job queue wait times, CPU and memory saturation and disc space utilisation across all pools. Automated alerting ensures that any offline agents or degraded build nodes are replaced before they become a bottleneck to release schedules.

Hybrid Architecture Choosing the Right Approach

In practice, mature engineering organisations rarely make the binary choice of Microsoft hosted agents or self-hosted agents. Instead, they employ a tiered hybrid approach that maps each stage of the software delivery lifecycle to the best execution environment.

In a hybrid model, continuous integration pipelines for pull request validation, static code analysis, linting, and unit testing default to using Microsoft-hosted agents. The advantages of executing unmerged code are an infinite capacity for horizontal bursts, zero maintenance, and excellent ephemeral isolation. Conversely, tasks that involve the compilation of many codes, local caching of large amounts of data, use of private compilers, and access to internal database networks belong to self-hosted pools or Managed DevOps Pools.

Microsoft-hosted agents are used by teams by default, while self-hosted agents are used only in the event of networking problems or hardware performance issues.

Conclusion

Ultimately, build and release infrastructure management in Azure DevOps is about aligning operational ownership, security perimeters, network topology, and financial scale with the reality of your software delivery lifecycle. Microsoft-hosted and self-hosted agents run the same pipeline definitions, but they are different philosophies of cloud engineering at their core.

Microsoft-hosted agents are great as a no-friction, zero-maintenance baseline. Their ephemeral architecture avoids configuration drift, cross-build contamination, and the headache of operating system patching and runtime upgrades by providing each pipeline job with a clean, freshly provisioned virtual machine that is destroyed immediately after the job is complete. Microsoft-hosted pools provide immediate horizontal scalability and predictable flat-rate licensing with no infrastructure management overhead for standard microservices, unit testing, static analysis and validation of open-source or untrusted pull requests.

By contrast, self-hosted agents sacrifice operational convenience for deep customisation, persistent state, and private network reach. Self-hosted agents are critical for organisations that operate behind strict corporate firewalls, require private peering to internal databases and on-premises servers, or rely on specialised hardware such as custom GPUs, macOS build farms, or high-throughput solid-state storage. The ability to keep warm package caches and container image layers between consecutive runs can also dramatically speed up heavy compilation pipelines. Elastic scaling patterns (e.g. Azure Virtual Machine Scale Set agents and Microsoft’s Managed DevOps Pools) allow teams to realise these benefits without paying for idle VMs during off-peak hours.

At the same time, self-hosted infrastructure requires a disciplined governance model. In persistent build environments, proactive workspace hygiene is necessary to avoid exhausting disc space. Strict pool segmentation is necessary to isolate privileged production release pipelines from lower-trust continuous integration workloads. Modern identity authentication is necessary via Microsoft Entra ID, not static secrets. It is equally important to have visibility into queue wait times, compute saturation, and agent health to avoid build nodes becoming silent bottlenecks.

Mature platform engineering teams do not opt to use Microsoft-hosted agents or self-hosted agents. They opt to use a hybrid model. Organisations strike the right balance by defaulting general continuous integration workloads to ephemeral Microsoft-hosted agents and directing workloads that are network-restricted, cache-intensive, or compliance-bound to governed self-hosted pools or Managed DevOps Pools. This balanced approach reduces routine maintenance and ensures that each pipeline stage is running in an environment designed for speed, security and cost efficiency.

Elastic Scaling being a process that involves the integration of cloud networking and CI/CD management, it can be stated that azure devops learning for the engineers will make them proficient in configuring the auto-scaling pools.

Why Choose Us

Master Your Future with OnlineITGuru

We don't just provide courses; we build careers. From expert-led live training to dedicated placement support, discover why thousands of professionals trust us for their digital transformation journey.

200+

Partner Companies

$120K

Highest Package

75%

Average Hike

98%

Placement Rate

Reliable Career Partners

Google
Microsoft
Amazon
Meta
Netflix
Apple