> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/a/azure-devops-server-git.md).

# Azure DevOps Server Git

Azure DevOps Server is the self-hosted Azure DevOps product. OctoXLabs reads the Git repositories of a project collection with their branches, open pull requests and latest commit.

## Use cases

* List every source codes asset that Azure DevOps Server Git contributes to the inventory.

```
Adapters = azure-devops-server-git
```

* Check what one Azure DevOps Server Git connection collected.

```
Connections = YOUR_CONNECTION_NAME
```

## Before you begin

### Network

| Source              | Destination                     | Port                                                         | Protocol                                 |
| ------------------- | ------------------------------- | ------------------------------------------------------------ | ---------------------------------------- |
| OctoXLabs connector | Azure DevOps Server (host name) | 8080 (configurable). Deployments over HTTPS usually use 443. | HTTPS, or HTTP when Is Secure is cleared |

### Required permissions

| Scope or role           | Permission | Needed for                                        |
| ----------------------- | ---------- | ------------------------------------------------- |
| Code (Read)             | Read       | Repositories, branches, pull requests and commits |
| Project and Team (Read) | Read       | Projects                                          |

The adapter uses REST API version 7.0, which needs **Azure DevOps Server 2022** or newer. Server 2019 and 2020 accept only older API versions and are not supported.

## Create credentials in Azure DevOps Server Git

{% stepper %}
{% step %}

### Open the portal

Sign in to the Azure DevOps Server web portal.
{% endstep %}

{% step %}

### Create a token

Go to **User settings** > **Personal access tokens** > **New Token**.
{% endstep %}

{% step %}

### Set scopes

Grant **Code (Read)** and **Project and Team (Read)**.
{% endstep %}

{% step %}

### Copy the token

Create the token and copy it.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Leave Username empty to use a personal access token. Fill it only when the server requires domain basic authentication; the Personal Access Token field then holds that account password.
{% endhint %}

## Connection parameters

| Parameter             | Required | Type    | Default           | Description                                                                                                                                                                                        |
| --------------------- | -------- | ------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Domain                | Yes      | String  | None              | Host name of the server, without scheme or port, for example `tfs01.corp.local`.                                                                                                                   |
| Port                  | No       | Integer | 8080              | Port the server listens on.                                                                                                                                                                        |
| Is Secure             | No       | Boolean | True              | Use HTTPS. Clear it to use HTTP.                                                                                                                                                                   |
| Collection            | No       | String  | DefaultCollection | Project collection to inventory.                                                                                                                                                                   |
| Virtual Directory     | No       | String  | Empty             | IIS virtual directory between the host and the collection. For `https://tfs01.corp.local:8080/tfs/DefaultCollection` enter `tfs`. For `https://tfs01.corp.local/DefaultCollection` leave it empty. |
| Project               | No       | String  | Empty             | Limit discovery to one project (case-insensitive match). Empty means all projects.                                                                                                                 |
| Username              | No       | String  | Empty             | Leave empty for a personal access token. Fill it for domain basic authentication.                                                                                                                  |
| Personal Access Token | Yes      | String  | None              | Token, or the account password when Username is set.                                                                                                                                               |
| Proxy                 | No       | String  | None              | Proxy address. The connector sends requests through `http://<value>`.                                                                                                                              |
| Thread Count          | No       | Integer | 8                 | Parallel threads that enrich repositories. Minimum 1, maximum 32.                                                                                                                                  |
| Sleep Time            | No       | Integer | None              | Delay in seconds between thread batches. Increase it if the server is under heavy load.                                                                                                            |
| Timeout               | No       | Integer | 30                | Time in seconds to wait for API responses.                                                                                                                                                         |

## Troubleshooting

| Error message                                                                                                                | Cause                                                                  | Fix                                                                                                                                           |
| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Expected a JSON response from but got ''. Check the personal access token and the authentication mode enabled on the server. | The server answered 200 with an HTML sign-in page.                     | Check the token and the authentication mode of the server.                                                                                    |
| Status Code: `, followed by the URL, the method and the response body`                                                       | The API answered with a status other than the one the adapter expects. | Read the code and body. 401 or 403 usually points to wrong credentials or missing permissions. Check the address, port and Is Secure setting. |

## Change history
