Learning about the Agents in Azure Pipeline: Microsoft-hosted, Self-hosted
Azure Pipeline agents are a key component of the Azure DevOps CI/CD workflow. They run build and release jobs defined in pipelines. Azure offers Microsoft-hosted and self-hosted agent types to suit different project needs.
1. Microsoft-Hosted Agents
Microsoft provides and manages these agents in the cloud, offering a pre-configured environment to execute pipeline jobs.
Features
Pre-installed Tools: Includes popular development tools (e.g., .NET, Node.js, Python, Java, etc.) with updated versions.
Automatic Updates: Maintained and updated by Microsoft.
Scalability: Dynamically scales to handle pipeline demands.
Pay-per-use Model: Billed based on pipeline runtime.
Pros
No setup or maintenance required.
Quick and easy to get started.
Regularly updated with the latest versions of tools and libraries.
Ideal for teams without infrastructure expertise.
Cons
Limited customization (only supports predefined images).
Shared infrastructure can lead to unpredictable performance.
Limited job execution timeout (default 6 hours).
No persistent storage; all files and changes are reset after each job.
Use Cases
Small to medium-sized projects.
Scenarios requiring a quick and simple CI/CD setup.
Teams needing minimal customization.
2. Self-Hosted Agents
Overview
These are machines that you manage and configure to run your pipeline jobs. They can be hosted on-premises, in a private data center, or in your preferred cloud environment.
Features
Full Control: Customize the environment, install required tools, and configure settings as needed.
Persistent Storage: Files and artifacts can persist across builds.
Hardware Choice: Choose your own machine specifications for better performance.
Isolation: Dedicated infrastructure for enhanced security.
Pros
Supports custom tools, configurations, and environments.
Persistent data between builds for faster pipelines.
Consistent performance with dedicated resources.
Enhanced security for sensitive or regulated workloads.
Cons
Requires setup and ongoing maintenance.
Scaling can be complex without automation.
Higher upfront costs for hardware or cloud resources.
Use Cases
Large or complex projects requiring custom build environments.
Highly regulated industries needing secure, isolated infrastructure.
Scenarios needing specific tools, software versions, or persistent data.
Comparison: Microsoft-Hosted vs. Self-Hosted
Feature | Microsoft-Hosted | Self-Hosted |
---|---|---|
Setup & Maintenance | None, fully managed | Managed by you |
Customization | Limited to predefined VMs | Full control over software |
Performance | Shared infrastructure | Consistent, dedicated |
Scalability | Automatic | Manual or scripted |
Security | Shared by Microsoft | Fully isolated by you |
Cost | Pay-per-use | Hardware/cloud resource cost |
Persistent Storage | Not supported | Supported |
Timeout Limit | 6 hours | Configurable |
Decision Criteria
Choose Microsoft-Hosted Agents:
When you need simplicity, ease of use, and minimal setup, or if your project has standard requirements.
Choose Self-Hosted Agents:
When your projects demand customized environments, better security, or you need control over build performance.
Leave a Reply