Azure DevOps Self Hosted Agent Configuration

 Azure DevOps Self Hosted Agent Configuration 

___________________________

A self-hosted agent is a machine that you set up and manage to run your build and deployment jobs.Azure Pipelines does indeed offer both hosted and self-hosted agents. While Microsoft-hosted agents provide a convenient and managed option, self-hosted agents offer greater flexibility and control.


When to use a self-hosted agent:

1.Your build or deployment process requires specific software or configurations not available on Microsoft-hosted agents.

2.You need to leverage existing hardware resources.

3.You require better performance for resource-intensive tasks.

4.You want to have complete control over the agent environment. 




Setting up a self-hosted agent:


1.Install the agent: Download the agent from your Azure DevOps project and install it on the desired machine.


2.Configure the agent: Specify the agent pool, agent name, and authentication details.


3.Start the agent service: Start the agent service to make it available for job execution.




Go to agent pool ->Choose the Default Agent -> From there the tab  choose the agent -> Download the Agent package.






How to Get a Personal Access Token (PAT)


A Personal Access Token (PAT) is essentially a password that grants access to a specific set of actions within a platform. This is commonly used for automation, scripts, and other applications that require authentication without using your regular password. 


Commands Use for agent:

_________________________________


1.Start an elevated (PowerShell) window and set the location to where you unpacked the agent.


cd C:\agents



2.Run [ .\config.cmd ] This  will ask you a series of questions to configure the agent. 


3.The following command to start Agent :


[.\run.cmd]


To stop the Agent We use command  Ctrl+C to restart Agent run.cmd


4.Remove and reconfigure an agent

.\config remove



Post a Comment

0 Comments

Close Menu