Black Friday Hosting Deals: 69% Off + Free Migration: Grab the Deal Grab It Now!
Follow these detailed steps to set up self-hosted agents in Azure DevOps, which cover the prerequisites, installation, and maintenance of agents. Self-hosted agents provide essential flexibility and control for your CI/CD pipeline environment to meet specific project needs.
Self-hosted agents are machines you configure and oversee to execute tasks within Azure DevOps. They offer the option to install and set up software that may not be accessible on Microsoft-hosted agents, enabling personalized builds and deployments. This flexibility is particularly useful for projects requiring specific tools or configurations.
Cost Efficiency: Self-hosted agents can run jobs with unlimited minutes, while Microsoft-hosted agents have a limited free tier and additional costs for more usage.
Customization: You can install any software needed for your builds, making it easier to meet unique project requirements.
Performance: Self-hosted agents can maintain machine-level caches and configurations, improving build times.
Ensure that the setup of the self-hosted agent is in an environment with specific characteristics:
Operating System: The compatibility versions are Windows 7 SP1, Windows 10, or Windows Server 2012 and above or different Linux distributions.
Software Requirements: Ensure one has Power Shell 3 on the Windows. For Windows, ensure that you have at least 0 or higher installed, while for Linux, ensure that all the necessary dependencies for your builds have been met.
Network Access: The agent must have internet access to communicate with Azure DevOps services.
Sign in to your Azure DevOps profile using https://dev.azure.com/{your-organization}.
For better organization, create a new agent pool:
Navigate to Organization settings > Agent Pools.
Click Add Pool to create a new agent pool.
Select the agent pool you wish to use.
Click on New Agent.
Select an operating system (Windows, Linux, or macOS) and obtain the agent package by downloading it.
Unpack the downloaded agent package to a directory of your choice. For example, on Windows, you might use:
cd C:\agents
Run the configuration script:
For Windows, execute:
.\config.cmd
For Linux, execute:
./config.sh
While setting up, you will be asked to give information:
Server URL: For Azure DevOps Services, use https://dev.azure.com/{your-organization}.
Authentication Type: Choose from:
Personal Access Token (PAT)
Alternate authentication methods (Basic, Negotiate, or Integrated for Windows).
Decide whether to run the agent in interactive mode or as a service. Running as a service is recommended for better management and stability.
After installation, you can define capabilities for your agent:
Go to Project Settings> Agent Pools.
Select your agent pool and click on your agent.
Under the Capabilities tab, you can add new capabilities as needed.
In your build or release pipeline configurations, specify your preference for a self-hosted agent by selecting the agent pool containing your self-hosted agent.
Regularly check the status of your self-hosted agent in Azure DevOps. Keep the agent updated and consult logs for troubleshooting if issues arise.
Setting up self-hosted agents in Azure DevOps provides more flexibility and control of your CI/CD processes. By adhering to the steps provided, you can efficiently establish and oversee agents designed for your project's distinct requirements. This arrangement improves your workflow and guarantees that your builds and deployments are performed in a controlled environment that fulfils all essential criteria.
Using self-hosted agents, you can make the most of your infrastructure to enhance your software development and deployment procedures, turning them into a crucial resource within your DevOps toolkit.
Let’s talk about the future, and make it happen!
By continuing to use and navigate this website, you are agreeing to the use of cookies.
Find out more