> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/3.0/harness-platform-resources/connectors/code-repositories/connect-to-a-azure-repo.md).

# Connect to Azure Repos

Azure Repos is a set of version control tools that you can use to manage your code. Azure Repos provides Git distributed version control and Team Foundation centralized version control (TFVC).

You can use a Harness Azure Repos connector to connect to Azure Repos Projects and individual repositories.

### Requirements <a href="#requirements" id="requirements"></a>

You must have:

* An Azure Project and at least one repo.
* Permission to create connectors in Harness.
* A [Harness project](/harness-ai/new-to-harness-platform/get-started.md#create-an-organization).

### Create the connector <a href="#create-the-connector" id="create-the-connector"></a>

1. In Harness, go to **Project Settings**, **Organization Settings**, or **Account Settings**, depending on the scope where you want to create the connector. For example, a connector created at the project scope is only available within that project.
2. Select **Connectors**, select **New Connector**, and then select the **Azure Repos** connector.
3. Enter a **Name** for your connector, and then select **Continue**.
4. Select **Project** or **Repository** for the **URL Type**.
5. Select **HTTP** or **SSH** for the **Connection Type**.
6. Enter your Azure Repos Project or Repository URL.

   Make sure the URL uses the correct format for the URL Type and Connection Type. For example:

   * HTTP Repository URL: `https://ORG_OR_USER@dev.azure.com/ORG_NAME/PROJECT_NAME/_git/REPO_NAME`
   * HTTP Project URL: `https://dev.azure.com/ORG_NAME/PROJECT_NAME`
   * HTTP Project URL: `https://ORG_OR_USER@dev.azure.com/ORG_NAME/PROJECT_NAME`

   You can get the URL from Azure Repos.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>PROJECT URLS</strong></p><p>When copying Project URLs from Azure Repos remove <code>_git/REPO_NAME</code> from the URL path.</p><p>For Project URLs, don't include <code>_git</code> or a repo name in the <strong>Azure Repos Project URL</strong> field.</p><p>Examples of <strong>invalid</strong> Azure Repos Project URL formats include:</p><p><code>https://USER@dev.azure.com/ORG/PROJECT/_git</code> <code>https://USER@dev.azure.com/ORG/PROJECT/_git/REPO</code> <code>https://dev.azure.com/ORG/PROJECT/_git</code> <code>https://dev.azure.com/ORG/PROJECT/_git/REPO</code></p><p>To make these <strong>valid</strong>, exclude <code>_git</code> and the repo name. For example, these are <strong>valid</strong> Azure Repos Project URLs:</p><p><code>https://USER@dev.azure.com/ORG/PROJECT</code> <code>https://dev.azure.com/ORG/PROJECT</code></p></div>
7. If you selected **Project**, in **Test Repository**, enter the name of a repository that Harness can use to test the connector's connection.
8. Select **Continue**, and then configure **Credentials** based on the **Connection Type**:
   * For HTTP connections, enter the username and password to access the project or repo.
   * For SSH connections, you must provide an SSH private key stored in a [Harness encrypted text secret](/harness-ai/use-harness-platform/secrets/add-use-text-secrets.md). You can use `ssh-keygen -t rsa` to create a private SSH key. For more information, go to the Microsoft documentation on [Creating SSH Keys](https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops#step-1-create-your-ssh-keys).
9. If required, select **Enable API Access**. This is recommended, and it is required to use Git event triggers, webhooks, and send build and PR statuses between Azure Repos and Harness.
   * You need an [Azure Repos Personal Access Token](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops\&tabs=Windows#create-a-pat) to enable API access.
   * In **Personal Access Token**, select a [Harness encrypted text secret](/harness-ai/use-harness-platform/secrets/add-use-text-secrets.md) containing an Azure Repos Personal Access Token. Harness requires the token for API access. Generate the token in your Azure account, and then add it to Harness as a secret.
10. Select **Continue**, and then select whether to connect through the Harness Platform or a Harness Delegate. If you plan to use this connector with [Harness Cloud build infrastructure](/continuous-integration/use-harness-ci/use-harness-ci/set-up-build-infrastructure/use-harness-cloud-build-infrastructure.md), you must select **Connect through Harness Platform**.
11. If you selected **Connect through a Harness Delegate**, you must configure the delegate connection. 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 that you want Harness to use with this connector.

12. Select **Save and Continue**, and then wait while Harness tests the connector's connection. If the test succeeds, select **Finish**.

### Kubernetes delegate with self-signed certificates <a href="#kubernetes-delegate-with-self-signed-certificates" id="kubernetes-delegate-with-self-signed-certificates"></a>

If your codebase 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, as described in [Configure a Kubernetes build farm to use self-signed certificates](/continuous-integration/use-harness-ci/use-harness-ci/set-up-build-infrastructure/k8s-build-infrastructure/configure-a-kubernetes-build-farm-to-use-self-signed-certificates.md#enable-self-signed-certificates).
