TeamCity On-Premises 2021.1 Help

Integrating TeamCity with VCS Hosting Services

You can create presets of connections to the following hosting services:

Once created, such a connection can serve as a base for different operations: creating projects from URL, creating VCS roots, integrating with issue trackers, and authenticating users in TeamCity using their external profiles.

Connections are configured on the Project Administration | Connections page. Each connection is accessible in the current project and all its subprojects. If you use global VCS hosting services for your whole organization, it makes sense to configure a single connection to such a service on the Root project level. This way, the users will be able to quickly access the list of the organization's repositories when creating subprojects or editing projects' settings.

Adding a GitHub connection

Connecting to GitHub

There are two types of GitHub connections: GitHub Enterprise and GitHub.com. Choose it depending on your GitHub account type.

A connection to GitHub can be used to:

The GitHub connection form provides multiple parameters. You need to use them to create a new OAuth application in GitHub.

After the app is created:

  1. Copy its client ID and secret.

  2. Go back to the connection form in TeamCity.

  3. Paste the GitHub server URL (only for Enterprise) and the app ID and secret.

  4. Save the connection.

If you use a GitHub Enterprise server with HTTPS, you need to also upload its HTTPS certificate as described here.

A GitHub icon will become active in several places where a repository URL can be specified. Click it to authorize TeamCity in your GitHub profile. TeamCity will be granted full control of your private repositories and get the Write repository hooks permission. If you configure multiple GitHub connections, the server URL will be displayed next to each icon, so it is easier to distinguish the server in use.

Connecting to Bitbucket Cloud

A connection to Bitbucket Cloud can be used to:

The Bitbucket Cloud connection form provides multiple parameters. You need to use them for creating a new OAuth consumer in Bitbucket.

After the consumer is created:

  1. Copy its key and secret.

  2. Go back to the connection form in TeamCity.

  3. Paste the key and secret.

  4. Save the connection.

A Bitbucket icon will become active in several places where a repository URL can be specified. Click it to authorize TeamCity in your Bitbucket profile. TeamCity will be granted access to your public repositories. For private repositories, you will need to provide Bitbucket credentials to be used for authentication by TeamCity, as Bitbucket Cloud does not provide non-expiring access tokens. See the related discussion. If you configure multiple Bitbucket connections, the server URL will be displayed next to each icon, so it is easier to distinguish the server in use.

Connecting to GitLab

There are two types of GitLab connections: GitLab CE/EE and GitLab.com. Choose it depending on your GitHub account type.

A connection to GitLab can be used to:

The GitLab connection form provides multiple parameters. You need to use them to create a new OAuth application in GitLab.

After the app is created:

  1. Copy its client ID and secret.

  2. Go back to the connection form in TeamCity.

  3. Paste the GitLab server URL (only for CE/EE) and the app ID and secret.

  4. Save the connection.

If you use a GitLab CE/EE server with HTTPS, you need to also upload its HTTPS certificate as described here.

A GitLab icon will become active in several places where a repository URL can be specified. Click it to authorize TeamCity in your GitLab profile. TeamCity will be granted access to your repositories. If you configure multiple GitLab connections, the server URL will be displayed next to each icon, so it is easier to distinguish the server in use.

Connecting to Azure DevOps Services

A connection to Azure DevOps Services (or Azure DevOps Server, formerly Team Foundation Server) can be used to:

Before configuring this connection, you need to sign in to your Azure DevOps account and create a personal access token with All scopes as described here

Then, go back to the connection form in TeamCity:

  1. Enter your Azure server URL:
    • https://{account}.visualstudio.com for Azure DevOps

    • https://{server}:8080/tfs/ for VSTS

  2. Paste your Azure token.

  3. Save the connection.

An Azure DevOps icon will become active in several places where a repository URL can be specified. Click it to authorize TeamCity in your Azure profile. TeamCity will be granted full access to all the Azure resources available to you. If you configure multiple Azure connections, the server URL will be displayed next to each icon, so it is easier to distinguish the server in use.

Last modified: 19 May 2021