Add an Azure Repos connector
Add an Azure Repos connector so Harness pipelines can pull code and other files from your Azure Repos projects and repositories.
Azure Repos is part of Azure DevOps and offers two version control models: Git, a distributed system compatible with standard Git tools, and Team Foundation Version Control (TFVC), a centralized system, specific to Azure DevOps. Harness connectors work with Azure Repos Git repositories. Harness does not support TFVC repositories because TFVC is not Git-compatible.
You connect Harness to Azure Repos using a Harness Azure Repos connector. The connector allows you to pull code and other files, such as Helm charts, Kubernetes manifests, and Terraform scripts, from your Azure Repos repositories for use in Harness pipelines.
The connector works with Azure DevOps Services (dev.azure.com) and with self-hosted Azure DevOps Server 2020 and newer. For Azure DevOps Server, you can create the connector with either HTTP or SSH, and use it for Git Experience, bidirectional sync, and Harness CI.
Go to Overview for information about all code repos connectors, such as scopes, permissions and connectivity modes.
What you will learn from this topic
How to add an Azure Repos connector to a Harness project so pipelines can pull code from Azure Repos or Azure DevOps Server.
Before you begin
Before you create an Azure Repos connector, ensure you have:
An Azure DevOps organization with at least one project and one repository.
A username and password, or a personal access token, with permission to read (and, if needed, write status checks to) the repositories you want to connect to.
Permission to create connectors in Harness.
For Azure DevOps Server, version 2020 or newer, the
PIPE_ENABLE_AZURE_DEVOPS_SERVER_SUPPORTfeature flag enabled, and Harness Delegate version 26.10.90209 or newer.
Add an Azure Repos connector
You can add an Azure Repos connector at the project, org, or account scope. This procedure covers the project scope, and the process is the same for org and account.
You can also add an Azure Repos connector directly when configuring an Azure Repos codebase or artifact source in a pipeline or service.
Perform the following steps to add an Azure Repos connector:
Open your Harness project.
In Project Settings, select Connectors.
Click New Connector, then select Azure Repos. The Azure Repos Connector settings appear.
Overview
Configure the identity fields for the connector.
In Name, enter a name for the connector. Optionally, add a description and tags. Click Continue.

Details
Configure the following details:
For URL Type, select one of:
Project: Connect to an entire Azure DevOps project. The connector can be used for every repository in that project.
Repository: Connect to a single Azure Repos repository.
For Connection Type, select HTTP or SSH.
Enter the Azure Repos Project URL or Azure Repos Repository URL, depending on the URL Type you selected. For example:
Repository URL (HTTP):
https://ORG_OR_USER@dev.azure.com/ORG_NAME/PROJECT_NAME/_git/REPO_NAMEProject URL (HTTP):
https://dev.azure.com/ORG_NAME/PROJECT_NAMEorhttps://ORG_OR_USER@dev.azure.com/ORG_NAME/PROJECT_NAME
If you selected Project for URL Type, enter a Test Repository. Harness uses this repository only to validate the connection. You specify the actual repository to use when you reference the connector in a pipeline.
Click Continue.

Credentials
Configure the credentials based on the connection type you selected:
If you selected HTTP:
Username: Enter your Azure DevOps username. You can use plaintext or a Harness encrypted text secret.
Personal Access Token: Select or create a new Harness encrypted text secret to store your personal access token.
If you selected SSH:
Select or create a new Harness SSH credential secret to store your SSH private key. The SSH credential's Username must be
git. Go to the Microsoft documentation on Using SSH keys to authenticate to generate a key.

Select Connectivity Mode
Select how Harness connects with Azure Repos:
Connect through Harness Platform: Use a direct, secure communication between Harness and Azure Repos. All credentials are encrypted and stored in the Secret Manager configured in Harness. This connectivity mode is required for Harness Cloud build infrastructure.
Connect through a Harness Delegate: Harness communicates with Azure Repos through a Harness Delegate you install in your environment, behind your corporate firewall.

Delegates Setup
If you selected Connect through a Harness Delegate, select either:
Use any available Delegate: Harness selects an available delegate at runtime.
Only use Delegates with all of the following tags: Select specific delegates for Harness to use with this connector.
Click Save and Continue.

Test Connection
Click Finish after the connection test succeeds. The connector is listed in Connectors.
If the connection test fails:
Confirm the project or repository URL matches the format for your selected URL Type and Connection Type, and that a Project URL excludes
_gitand the repo name.Confirm the credential secret has not expired and has the required repository permissions.
If you are connecting through a delegate, confirm the delegate can reach Azure DevOps over the network.
Sample YAML
The following example shows a YAML for the Azure Repos connector created in this guide.
For the full connector YAML schema, including how to skip connector preflight checks, go to Create a connector using YAML.
Next steps
Use delegate selectors: control which delegates can connect to this connector.
Add a secret manager: store connector credentials in a secret manager instead of the Harness built-in secret manager.
Last updated
Was this helpful?