Azure DevOps–Reconfiguring an Agent

This post looks at how to re-configure a local Azure DevOps agent when you need to change to a new pool or organization.

PAT Expired

I got a note that one of my personal access tokens (PAT) had expired, and I wanted to update the agent. I ran config, but saw this, I need to remove the config first.

However, when I ran “config remove”, which is how you can reconfigure an agent, I got this:

2020-10-12 10_04_34-cmd

In the image, the agent config asks for the PAT to allow it to authenticate to be removed. Since the agent doesn’t store this, and I don’t have it anymore, I can’t enter this. I can remove the agent from the portal, but there’s an easier way.

The Local Config

If you show hidden files, and if you are in tech, you always ought to do this, you will see a few in the agent folder. I name mine Agent, and inside, you can see there are .agent, .credentials, and .credentials_rsaparams files.

2020-10-12 10_17_22-agent

If I remove these three files, the agent doesn’t know where or how to connect. I can then run the config and re-set up the agent.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , . Bookmark the permalink.

2 Responses to Azure DevOps–Reconfiguring an Agent

  1. Rod Falanga says:

    Thank you for sharing this, Steve. It’s relevant to me.

    Like

  2. way0utwest says:

    you are welcome. Hope this helps.

    Like

Comments are closed.