For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Azure DevOps Server support requires a feature flag

Azure DevOps Server support is behind the feature flag PIPE_ENABLE_AZURE_DEVOPS_SERVER_SUPPORT. Contact Harness Support to enable it for your account. The steps to create the connector are the same for Azure DevOps Services and Azure DevOps Server.

What you will learn from this topic


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_SUPPORT feature 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:

  1. Open your Harness project.

  2. In Project Settings, select Connectors.

  3. 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.

Azure Repos connector Overview step with Name, Description, and Tags fields.

Details

Configure the following details:

  1. 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.

  2. For Connection Type, select HTTP or SSH.

  3. 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_NAME

    • Project URL (HTTP): https://dev.azure.com/ORG_NAME/PROJECT_NAME or https://ORG_OR_USER@dev.azure.com/ORG_NAME/PROJECT_NAME

  1. 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.

  2. Click Continue.

Azure Repos connector Details step with URL Type, Connection Type, Azure Repos Project URL, and Test Repository fields.

Credentials

Configure the credentials based on the connection type you selected:

Enable API access for build status updates and triggers

If you want to use Git Experience, send build or PR status updates back to Azure Repos, or to support Git event triggers and webhooks using the connector, select Enable API access and provide an Azure Repos personal access token as a Harness encrypted text secret.

Azure Repos connector Credentials step with Authentication set to SSH Key and Enable API access selected.

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.

Select Connectivity Mode step showing Connect through a Harness Delegate and Connect through Harness Platform options.

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.

Azure Repos connector Delegates Setup step with Use any available Delegate and Only use Delegates with all of the following tags options.

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 _git and 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.

Kubernetes delegate with self-signed certificates

If this connector allows API access and connects through a Harness Delegate that uses self-signed certificates, you must specify ADDITIONAL_CERTS_PATH in the delegate pod. Go to Configure a Kubernetes build farm to use self-signed certificates for details.


Sample YAML

The following example shows a YAML for the Azure Repos connector created in this guide.

YAML - Azure Repos connector

For the full connector YAML schema, including how to skip connector preflight checks, go to Create a connector using YAML.


Next steps

Last updated

Was this helpful?