Linux – automatically authorize teamcity agents

automationlinuxteamcity

We have some TeamCity build agents running and I'd like to destroy and rebuild all agents over night automatically to have a clean set of agents in the morning.
Destroying and provisioning the agent isn't a problem but I can't find a way to authorize the fresh agents automatically.
The TeamCity documentation talks about the web UI only which is a pretty bad starting point for automation.

Anyone got a solution for this?

Best Answer

Teamcity does not provide automatic agent authorization other than UI but if you are using same server/host names you can try by backing-up and restoring of agent.properties file as specified by Marcel. this file will have the authorization key of the agent

as rightly pointed, documentation link has just UI level authorization, no CLI or plugins and is hard way to do it in bulk

from Documentation:

they are authorized in the TeamCity web UI.

The agent running on the same computer as the server is authorized by default.

Related Topic