Update PAT of Self hosted agent

Viewed 820

The user from whose PAT a self hosted agent was configured is leaving the organization. Once the users leaves the org, his account would be deleted from Azure AD and hence his PAT would be expired. How should one take over the self hosted agent or update the PAT with other users account?

I was unable to see any MSFT docs w.r.t PAT updates. Is uninstalling and reinstalling the only option in this scenario?

2 Answers

Inside the install directory of the agent (in my case it was C:\agent), you will find some files including

  • config.cmd
  • run.cmd

You can reconfigure your agent without uninstalling by running config.cmd editing the values and then run the agent again with run.cmd. You will be prompted to provide the PAT and also the agent pool. You can change only the values that you need.

Related