Azure-pipelines-agent: How to remove on-prem agent if VSTS URL has changed?

Created on 23 Aug 2016  路  7Comments  路  Source: microsoft/azure-pipelines-agent

Agent version and platform

Version of your agent? 2.105.0


OS of the machine running the agent? Windows

VSTS type and version

VisualStudio.com

What's not working?

The VSTS URL has changed but when I try to do .\config remove I get:

$ .\config remove
Removing service
Removing agent from the server
Enter authentication type (press enter for PAT) >
Enter personal access token > ****************
Failed: Removing agent from the server
The resource cannot be found.

Most helpful comment

If what you're trying to do is re-register the agent with a new visualstudio.com account (because the old one is no longer operational), you can delete the .agent, .credentials and .credentials_rsaparams files in the root of the folder. After that run ./config.cmd again and reconfigure as if it were a fresh install.

I think the same applies to when the _visualstudio.com_ account has been renamed (through the Admin settings).

All 7 comments

@jdshkolnik what do you mean by VSTS URL has changed ?

@TingluoHuang Change the Account URL under Advanced administration tasks in the settings page: https://.visualstudio.com/_admin/_home/settings

You can delete in the web admin UI and just wack the agent folder.

If what you're trying to do is re-register the agent with a new visualstudio.com account (because the old one is no longer operational), you can delete the .agent, .credentials and .credentials_rsaparams files in the root of the folder. After that run ./config.cmd again and reconfigure as if it were a fresh install.

I think the same applies to when the _visualstudio.com_ account has been renamed (through the Admin settings).

I just had this same issue... was ugly.

Do the following

  1. Using the Web UI, delete the agent.
  2. .\config.cmd remove
  3. It will ask for PAT/credentials. Just hit ctrl+c. At this point, the agent has been removed as a service from the machine, its only asking for creds to try and remove itself from Azure.
  4. Delete the agent inside C:\azagent\<A*>. Some of you might have multiple agents, so just delete the A* folder inside C:\azagent\*
  5. Paste the new register command with PAT that you copied from the UI.

If there is a simple place to update the URL for the azagent like the registry or a config file, I would sure love to know it.

Thanks.
What If the servers are decommissioned and I want to remove the Build Agents which are offline on Web UI. Is there any option to remove the Red ones.
Thanks

I think you just go to organization settings and then find the deployment agents and click remove in the upper right. I'm not at a computer so those aren't exact steps but the UI has a remove button.

Was this page helpful?
0 / 5 - 0 ratings