Build source repositories

Azure Pipelines | Azure DevOps Server 2019 | TFS 2018 | TFS 2017 | TFS 2015

Note

In Microsoft Team Foundation Server (TFS) 2018 and previous versions, run and release pipelines are called definitions, runs are called builds, service connections are called service endpoints, stages are called environments, and jobs are called phases.

Configure a repository

At the beginning of each non-deployment pipeline job, the agent downloads files from your repository into a local sources directory. You can specify only one source repository for your entire pipeline. Deployment jobs do not automatically download sources.

At the beginning of each pipeline job, the agent downloads files from your repository into a local sources directory. You can specify only one source repository for your entire pipeline.

At the beginning of a pipeline, the agent downloads files from your repository into a local sources directory.

Azure Pipelines: To specify the source repository, while editing your pipeline, click the YAML or Tasks tab, then click Get sources, and then select the type of repo that contains your source files.

TFS 2018: To specify the source repository, while editing your pipeline, click the Tasks tab, then click Get sources, and then select the type of repo that contains your source files.

TFS 2017: To specify the source repository:

  • TFS 2017.3 Click the Tasks tab, then click Get sources, and then select the type of repo that contains your source files.

  • TFS 2017 RTM Click the Repository tab, and then select the type of repo that contains your source files.

TFS 2015: To specify the source repository, click the Repository tab, and then select the type of repo that contains your source files.

Supported repository types

You can choose from the following repository types:

Repository type Azure Pipelines (YAML) Azure Pipelines (classic editor) Azure DevOps Server 2019, TFS 2018, TFS 2017, TFS 2015.4 TFS 2015 RTM
Azure Repos Git Yes Yes Yes Yes
Azure Repos TFVC No Yes Yes Yes
Bitbucket Cloud Yes Yes No No
Other Git (generic) No Yes Yes Yes
GitHub Yes Yes No No
GitHub Enterprise Server Yes Yes TFS 2018.2 and higher No
Subversion No Yes Yes No

Specific repository details

See details about building specific repository types:

Note

To build code from Subversion, you must install a Subversion client (svn) on your self-hosted build agents or use Microsoft-hosted build agents.

Options for Git repositories

See Pipeline options for Git repositories for options available to pipelines that use a Git repository.

Q & A

Why are some repository types not supported by on-premises installations?

When a pipeline uses a remote, 3rd-party repository host such as Bitbucket Cloud, the repository is configured with webhooks that notify Azure Pipelines Server or TFS when code has changed and a build should be triggered. Since on-premises installations are normally protected behind a firewall, 3rd-party webhooks are unable to reach the on-premises server. As a workaround, you can use the Other Git or External Git repository type which uses polling instead of webhooks to trigger a build when code has changed.

How do I reference the directories on the build agent?

Reference directories using build variables such as $(Build.SourcesDirectory) and $(Build.BinariesDirectory). To learn more, see Build variables.

Do I need an agent?

You need at least one agent to run your build or release. Get an agent for Linux, macOS, or Windows.

I'm having problems. How can I troubleshoot them?

See Troubleshoot Build and Release.

I can't select a default agent pool and I can't queue my build or release. How do I fix this?

See Agent pools.

I use TFS on-premises and I don't see some of these features. Why not?

Some of these features are available only on Azure Pipelines and not yet available on-premises. Some features are available on-premises if you have upgraded to the latest version of TFS.