TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Accessing Server from Scripts

Last modified: 20 April 2023

Since version 2.1 TeamCity server supports basic HTTP authentication which allows 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.

To use basic HTML authentication instead of redirecting to login page, prepend path in usual TeamCity URL with "/httpAuth".

Example: http://buildserver:8111/httpAuth/action.html?add2Queue=bt7

Two useful cases to use HTTP authentication are Patterns For Accessing Build Artifacts and triggering a build.

Triggering a Build from script



To trigger a build send HTTP GET request for the URL: http://<server address>/httpAuth/action.html?add2Queue=<build type Id> performing basic HTTP authentication.

Some tools (e.g. Wget) support the following syntax for basic HTTP authentication:

http://<user name>:<user password>@<server address>/httpAuth/action.html?add2Queue=<build type Id>

Example: http://testuser:testpassword@teamcity.jetbrains.com/httpAuth/action.html?add2Queue=bt10