Contact Us

When it comes to the build and release of the processes, there could be several performance issues you might face. In addition, a load of tasks over a single system degrades performance. Hence, a solution that enhances the turnaround time for tasks is required.

Servers like TFS 2017 and Azure, agents have played a crucial role in optimizing processes and addressing the issues faced by organizations. Agents ensure optimal build and release processes with a pool of customizable options to opt from.

This article will briefly take you through the descriptions and need for agents on your servers. Below is the comprehensive step-by-step guide for you to configure the agent pool in TFS 2017.

What is an Agent?

The agent is a server with the appropriate operating system and the tools installed and configured.

Agent pools

These are used to organize the agents based on project collections and projects so that the agents don't have to be managed individually.

Prerequisites

  • An OS that supports VS 2013 or higher
  • VS 2013 or 2015
  • PowerShell 3 or higher

 

Steps for configuring agent pool in TFS 2017

  • To configure the agent in an agent pool, you should have administrator rights.
  • Enter into the TFS URL
  • This will open the agent pool for the project collection, as shown in the image below

Image 1

Download the agent

  • Click on the download agent link on the left side to download the zip file.

Image 2

  • It will ask you to save/open the zip file. Save the agent.zip file.

Image 3

  • Extract the zip file.

Image 4 

  • This will give the below content inside the Agent folder.

Image 5

Configure the agent

  • To configure the agent, right-click on RunAgent.cmd and run as an administrator, as shown.
  • Now, right-click on the ConfigureAgent and run as administrator.

Image 6

Enter Details

  • cmd.exe opened in administrator mode with prompts. It will prompt the replacement of server registration and update the local agent settings. Press N

 

1. Agent Name

Enter the Name of this agent [if you would like to change]. By default, it takes your system name as a prefix with the word Agent as your agent name. Press enter for the default one.

Image 7

2. TFS Server Name

Now, enter your TFS server Name and press enter.

Image 8

3. App Pool Name

Configure the agent under the ‘Default’ Agent Pool and hit enter.

Image 9

4. Agent’s Working Folder

By default, it will create a Folder_work in the same location where you are configuring your Agent. If you want to make any other folder as Agent’s working directory, then provide the path here. Later this working folder is used to download the source code and run the builds.

Image 10

5. Run Agent as Service

Now, this is an important point here, run the agent as a Windows Service, so press ‘Y’ and hit enter.

Image 11

6. Enter Administrative Credentials for Agent Service

Provide credentials for the service. These credentials must have administrator rights.

Image 12

7. Agent as a service installed successfully

We can see the _work folder under Agent as shown below.

Image 13

Steps for configuring agent pool in AZURE

Azure DevOps supports the following two types of Agents:

Microsoft Hosted Agent: These agents are managed by Microsoft
Self-Hosted Agents: These are created and managed by the customer.

Most of the time, using Microsoft-hosted Agents should be good. However, below are the scenarios in which you should look at configuring Self-hosted Agents

  • If 10GB of free space in the Virtual Machine (Agent) is insufficient for your build needs.
  • When you want a Virtual Machine, whose capacity is greater than that of Standard DS2V2
  • When you would like to use Software that is not available in the Microsoft-hosted Build Agents

 

Prerequisites:

  • A Valid Azure DevOps account. You can create one at dev.azure.com
  • Create an ADO Organization
  • Create a Project
  • A Server that you would like to make as an Agent

 

If you are planning to use Azure DevOps, it is mandatory to understand Agent Pool. To build or run your code in a build pipeline you need Agents in Azure DevOps service. When you run a job in a build, Agent in Agent Pool supports the process.

Go to project settings and click on Agent Pools. By default, there are 2 pools.

Image 14

Azure Pipelines hosted pool,(Each time you run a pipeline, you get a fresh virtual machine.)

You can manage these pools in Azure DevOps Yaml file as well

Image 15

Default Pool: Use it to register self-hosted agents that you can set up. You have to manage on your own.

Image 16

Before you proceed further make sure you generate Access Token (PAT) beforehand. It is available in your profile settings.

Image 17

Image 18

Now, move to the machine or system which is going to work. Install it using instructions given by Microsoft. While running it you have to provide a few details so that it can configure itself.

Image 19

--auth pat: - specifies your personal access token--pool  - pool name for the agent to join--agent  - agent name--work  - work directory where job data is stored.

Once you run the agent, check the status in Azure Console.

Image 20

Summing Up

Agents are the component that typically functions to build and release systems to execute tasks with enhanced performance. In TFS 2017, it has a broader role in achieving several functions like making the code, running the tests, and deploying the application at the end.

Azure and TFS 2017 cater to you with a pool of features and tools to manage agents and allow you to easily install, update and remove the agents, along with analyzing the usage and performance metrics. Get in touch with us for more concerns you might have.

Need Help?
SUBSCRIBE US
interesting stuff and updates to your email