The TeamCity server supports basic HTTP authentication allowing to access certain web server pages and perform actions from various scripts.
Use valid TeamCity server username and password to authenticate using basic HTTP authentication.
tip
You may want to Using HTTPS to access TeamCity server the server to use HTTPS as username and password are passed in clear text during basic HTTP authentication.
To use a basic HTML authentication instead of redirecting to the login page, prepend a path in usual TeamCity URL with "/httpAuth". For example:
If you have Guest user enabled, it can be used to perform the action too. Use "/guestAuth" before thr URL path to perform the action on Guest user behalf. For example:
In TeamCity Enterprise version, please make sure the user used to perform the authentication (or Guest user) has appropriate role to perform the necessary operation.
Triggering a Build From Script
To trigger a build, send the HTTP GET request for the URL: http://<server address>/httpAuth/action.html?add2Queue=<build type Id> performing basic HTTP authentication.
Some tools (for example, Wget) support the following syntax for the basic HTTP authentication:
http://<user name>:<user password>@<server address>/httpAuth/action.html?add2Queue=<build type Id>
Since TeamCity 3.0, you can trigger a build on a specific agent passing additional agentId parameter with the agent's Id. You can get the agent Id from the URL of the Agent's details page. For example, you can infer that agent's Id equals "2" if it's details page has the following URL: