]> TFS side-by-side build and deployment agent 🌐:aligrant.com

TFS side-by-side build and deployment agent

Alastair Grant | Thursday 1 November 2018

We have a general purpose web-dev VM for running test web-sites.  It has a build agent on it already for building web-sites, this works fine.  But the newer release scripts utilise Deployment Groups, which use agents.

Great, so I tried to deploy a release agent on the same server.  Buzzt.  This can't be done due to an agent already being registered:

Cannot configure the agent because it is already configured. To reconfigure the agent, run 'config.cmd remove' or './config.sh remove' first.

There is an obscure bug report mentioning that an agent can only be used for build or release, not both.  It alludes to the idea of installing multiple agents - confirmed by Microsoft Azure Pipeline Agent documentation.

I wondered if I had a failed install and removed the deployment agent, but it removed the build agent - but it did let me install a deployment agent then.  I think the problem stemmed from the build agent, which is installed slightly differently and potentially from a previous version of the agent.

To resolve the issue, I removed all the agents and deleted their directories from the server and started afresh.  I used the TFS deployment script for both the deployment agent and the build agent.  But made some changes.  For both agents, update the --agent parameter to have a more descriptive name than just the computer name (e.g. include the function it is performing).

For the build agent, the default deployment arguments need to be removed (--deploymentpool --deploymentpoolname XXXX), this will then install the agent as a build agent and not a deployment agent.

Hey presto, you should have two agents installed as a service, one doing build and one doing release.

Breaking from the voyeuristic norms of the Internet, any comments can be made in private by contacting me.