czyykj.com

Setting Up Your Own Self-Hosted Azure Pipeline Agent

Written on

Creating a Self-Hosted Azure Pipeline Agent

In this guide, we will explore how to address a common error encountered when running an Azure DevOps pipeline and how to set up your own agent to facilitate the execution of your pipeline.

Understanding the Pipeline Execution Error

When attempting to run a pipeline, you may encounter an error. There are two primary solutions to this issue:

  1. Request a parallelism grant by following the link provided in the error log.
  2. Set up your own agent and configure your local machine to act as a server by following the instructions detailed in this article.

If you find this guide helpful, please consider following my account for more updates.

Steps to Create Your Agent

To begin, navigate to your project in Azure DevOps. Click on Project Settings and select Agent Pools from the left sidebar.

Azure DevOps Project Settings

Next, choose Default from the options available.

Default Agent Pool Selection

Now, let’s proceed to create your agent.

Creating a New Agent

A pop-up window will appear. Select your operating system, download the agent, and follow the subsequent steps. In this instance, I selected Windows and opened the command shell—ensure you run it as an administrator.

Downloading the Agent

Create a new directory named agent and navigate to it.

New Agent Directory

Next, input the path of the agent you have just downloaded.

Path for the Downloaded Agent

Run the configuration command, which will prompt you for a Personal Access Token (PAT). Press enter first, and then input the PAT as outlined in the following steps.

Configuration Command Prompt

To generate a PAT, go to Azure DevOps and click on User Settings.

User Settings in Azure DevOps Creating a New PAT

Once created, copy the PAT.

Copying the Personal Access Token

Now, paste the PAT and respond with "N" for the subsequent commands.

Entering the PAT

Execute the following commands:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

Setting Execution Policy

Finally, execute the command: ./run.cmd. Your machine is now set up to listen for jobs from the pipeline.

Running the Agent

You will also need to install Docker Desktop and keep it open while running your pipeline.

Conclusion

I hope you found this information valuable. Feel free to share your thoughts, feedback, or comments. Connect with me on LinkedIn or follow my Medium account to stay updated.

Chapter 2: Video Tutorials

In this section, we will include video resources to help you further understand the setup process.

The first video titled "How to install self-hosted Azure pipeline agent on Windows" provides a detailed walkthrough of the installation process.

The second video, "Setting up and Managing a Self-Hosted Agent in Azure DevOps | AZ-400," offers insights into managing your self-hosted agent effectively.

Share the page:

Twitter Facebook Reddit LinkIn

-----------------------

Recent Post:

Understanding Project Progress Measurement Without Disruption

Learn effective ways to measure project progress without causing disruptions.

Reviving Nigeria's Refineries: A $25 Billion Dilemma

Despite investing $25 billion, Nigeria's refinery revival remains uncertain, raising concerns about efficiency and future energy strategies.

Harnessing Purpose and Time: Strategies for 2023 Success

Discover how to leverage purpose and time management for personal growth and overcoming challenges in 2023.