December 12, 2019

How to set up Agent Pool and Windows Agent in Azure

  December 12, 2019
In Azure world agents are computers that are connected to ADO account. It can be a VM or a local machine with any OS on it.

Agent pool

We can have more than one agent machine connected to ADO and those can be grouped. These agent groups in Azure is called agent pools.

In order to add an agent to azure account , we need to create an agent pool first.

Click on project settings in Azure to see the Agent pool option.

Now select Agent pool under pipelines section

Now we can see all the already created agent pools, From there we have to click on Add Pool button.

Then enter a name for the pool to create a new agent pool.

Adding agent to the agent pool

Now we can add any  number of agents to this agent pool and certain capabilities can also be set for those agents.

If we click on the agent pool name, we can see the list of agents already added to the agent pool.

*Before doing this , make sure you have admin permission to Agent pool

To add a new agent follow below steps.

In following screen , select the type of agent you are going to add.

Once you download the agent, copy the zip file to the agent machine which you would like to be an Azure agent and unzip inside any folder.

You can follow steps in below link in the agent machine to make it an Azure agent.

*If you are planning to run selenium UI based tests, Select non UI mode while agent configuration.

The new agent added can be viewed as below under the agent pool title.

Make sure you follow below points while using an azure agent
  • In Non UI mode , you need to keep the run bat file running in agent machine to see the agent online in ADO (A cmd screen will be running at all times)

  • Make sure the agent/agents are restarted if any OS restart happens(Due to windows update etc)
Once agent is setup, executing run bat file will start the agent again.

  • Keep an eye on PAT expiry date (Personal access token [PAT keeps the connection between our azure account and the agent)
  • An azure agent can be setup in Virtual machine as well as in a local PC
  • Make sure you have all the firewall permissions to do different operations.
  • Agents can be enabled/disabled from Azure agent pool.

Adding more than one agent in same machine

Yes that's right! you can add more that one agent in same machine and that will be shown as a separate agent in agent pool .
These agents can receive instructions from azure just like two separate machines running.

To do this, we need to copy and paste the downloaded agent zip file to another folder (and unzip of-course) and execute the config and run bat files like we did for the first time.

In below example, i am running three windows agents in same machine.


Thanks for reading How to set up Agent Pool and Windows Agent in Azure

« Prev Post

No comments:

Post a Comment

Bookmark this website for more workarounds and issue fixes.

Verify Zip file contents without extracting using C# + Selenium

While doing automation testing, we may get a scenario where we need to download a zip file and to validate the contents inside it. One way t...