Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force removal of TFS 2017 build agent

Tags:

tfs

Installed the tfs 2017 (update 1) build agent on a machine and ran config.cmd to connect it to a TFS server. That server had to be reconfigured and the original url that the build agent was pointing to is no longer valid. All I want to do is reconfigure the build agent to connect using the new url. When I run config.cmd again, it says that I must first call 'config.cmd remove' but when I run that, it fails because it is trying to reach out to the original url to remove itself from the agent pool.

How can I force it to uninstall so that I can configure a new one? I have even deleted the whole agent directory, re-extracted from zip, and tried again but it's detecting that it's configured from somewhere else.

like image 504
Tom Avatar asked Mar 22 '17 16:03

Tom


People also ask

How do I uninstall build agent?

In the Agent Managed pane, right-click the computers for which you want to uninstall the agent, and then select Uninstall.

How do I remove agents from agent pool Azure Devops?

in the pool page in the first time you can't see the "delete" button, but if you press on the right line and dragging him to the right you will see the button.


1 Answers

Delete/rename the .agent file and then try to unconfigure:

C:\TfsData\jessehouwing>config.cmd remove
Removing service
Waiting for service to stop...
Failed: Removing service
Could not find file 'C:\TfsData\jessehouwing\.agent'.

C:\TfsData\jessehouwing>config.cmd remove
Removing service
Succeeded: Removing service
Removing agent from the server
Cannot connect to server, because config files are missing. Skipping removing agent from the server.
Removing .credentials
Succeeded: Removing .credentials
Removing .agent
Does not exist. Skipping Removing .agent
like image 157
jessehouwing Avatar answered Sep 30 '22 03:09

jessehouwing