Azure DevOps Agent and Its Types
Introduction
When working with Azure DevOps pipelines, one important component often runs quietly in the background — the Agent.
You may create pipelines, define steps, and configure deployments, but none of that actually runs unless an agent executes those tasks.
In simple terms, an Azure DevOps Agent is the machine (or service) responsible for running your pipeline jobs.
What is an Azure DevOps Agent?
An Azure DevOps Agent is a compute resource that:
- Picks up jobs from your pipeline
- Executes build or release tasks
- Runs scripts, installs dependencies, and compiles code
- Reports the status back to Azure DevOps
Think of it like a worker:
Azure DevOps gives instructions → Agent executes them → Returns results
Without an agent, your pipeline is just a definition — nothing actually runs.
How Azure DevOps Agent Works
Here’s a simplified flow:
- You trigger a pipeline (manual, commit, or scheduled)
- Azure DevOps queues the job
- An available agent picks up the job
- The agent executes each step defined in the pipeline
- Results (success/failure/logs) are sent back
This process happens automatically once everything is configured.
Types of Azure DevOps Agents
There are two main types of agents:
1. Microsoft-Hosted Agent
These agents are managed by Microsoft and run in Azure.
Key Features:
- No setup required
- Pre-configured with popular tools (Node.js, .NET, Java, Python, etc.)
- Automatically maintained and updated
- Runs on fresh virtual machines for each job
Advantages:
- Quick to start
- Zero maintenance
- Scalable and reliable
Limitations:
- Limited customization
- No access to private networks by default
- Build time limits (based on plan)
When to Use:
- Learning Azure DevOps
- Open-source or public projects
- Standard build and deployment scenarios
2. Self-Hosted Agent
These agents run on your own infrastructure — your local machine, on-prem server, or cloud VM.
Key Features:
- Full control over environment
- Custom tools and dependencies can be installed
- Can access private networks and internal systems
Advantages:
- Highly customizable
- No strict time limits
- Better performance for large builds (if optimized)
Limitations:
- Requires setup and maintenance
- Responsibility for updates and security
- Scaling must be handled manually
When to Use:
- Enterprise applications
- Access to private databases or internal APIs
- Custom build environments
- Compliance or security requirements
| Feature | Microsoft-Hosted Agent | Self-Hosted Agent |
|---|---|---|
| Setup | No setup required | Manual setup needed |
| Maintenance | Managed by Microsoft | Managed by you |
| Customization | Limited | Full control |
| Network Access | Public only (by default) | Private + internal access |
| Cost | Included (with limits) | Infrastructure cost |
| Scalability | Automatic | Manual scaling |
Key Concepts Related to Agents
Agent Pool
A collection of agents grouped together. Pipelines pick agents from these pools.
Job
A unit of work assigned to an agent.
Parallel Jobs
Defines how many jobs can run simultaneously across agents.
Real-World Example
Let’s say you have a .NET application:
- Developer pushes code to Git
- Pipeline triggers automatically
- Agent performs:
- Restore NuGet packages
- Build the application
- Run tests
- Publish artifacts
Without the agent, none of these steps would execute.
Choosing the Right Agent
Choosing between Microsoft-hosted and self-hosted depends on your needs:
- Go with Microsoft-hosted if you want simplicity and speed
- Choose self-hosted if you need control, customization, or access to internal systems
In many real-world scenarios, teams use a mix of both.
Conclusion
Azure DevOps Agents are the backbone of your CI/CD pipeline.
They are responsible for executing every instruction defined in your pipeline — from building code to deploying applications.
Understanding how agents work and when to use each type helps you design more efficient, secure, and scalable DevOps workflows.