TeamCity 9.0 Help

Team Foundation Server

This page contains descriptions of the fields and options available when setting up a VCS root to connect to Microsoft Team Foundation Server Version Control. Common VCS Root properties are described here.

When connecting to a Visual Studio Online Git repository, select Git as Type of VCS.

TFS Settings

Option

Description

URL

Team Foundation Server URL in the following format:

TFS 2010+:http[s]://<TFS Server>:<Port>/tfs/<Project Collection Name> TFS 2005/2008: http[s]://<TFS Server>:<Port>

Root

Specify the root using the following format: $<project name><project catalogue>

UserName

Specify a user to access Team Foundation Server. This can be a user name or DOMAIN\UserName string. Use blank to let TFS select a user account that is used to run the TeamCity Server (or Agent for the agent-side checkout)

Password

Enter the password of the user entered above.

Agent-Side Checkout

The agent-side checkout is only supported on Windows agent machine (for Linux and Mac agent you can use the server-side checkout). It is also required to have Team Explorer installed on the agent machine.

TeamCity automatically creates a TFS workspace for each checkout directory used. The workspace is created on behalf of the user account specified in the VCS root settings.

The created TFS workspaces are automatically removed after a two-week idle time.

TFS does not allow several workspaces on a machine mapped to the same directory. TeamCity TFS agent-side checkout may attempt to remove intersecting workspaces to create a new workspace that matches the specified VCS root and checkout rules. Note that it is unable to remove workspaces created by another user.

Option

Description

Enforce overwrite all files

When the option is enabled, TeamCity will call TFS to update workspace rewriting all files.

Normally, there is no need to do forced update for every build. But, if you suspect that TeamCity is not getting the latest version from the repository, you can use this option.

Visual Studio Online

When configuring a VCS Root for a project hosted on Visual Studio Online, you have to enable alternate credentials support in your Visual Studio Online account.

Enabling Alternate Credentials

Applications that work outside the browser, such as the git client or the command-line TFS client, require basic authentication credentials to work. You can edit the VSO profile to set a secondary username that can be used in this case.

After navigating to your VSO account portal, use the menu at the top-right to edit your profile. The Credentials tab allows enabling alternate credentials. After clicking Enable alternate credentials, set a secondary username and password to use when configuring a VCS Root.

Connecting to Visual Studio Online TFVC

Configure the TFS Settings of the TeamCity VCS root:

Option

Description

URL

Enter the URL to your Visual Studio Online projects TFS path of the following format https://accountname.visualstudio.com/DefaultCollection/

Root

Define project root as$/ProjectName

Username and Password

Enter your Microsoft Account credentials or use the alternate credentials created earlier, where the username must be prefixed with ##LIVE##\.

For step-by-step instructions, see the related blog-post.

Last modified: 20 April 2023