> 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-services-git.md).

# Azure DevOps Services Git

Azure DevOps Services is the cloud Azure DevOps product. OctoXLabs reads the Git repositories of an organization with their branches, open pull requests and latest commit.

## Use cases

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

```
Adapters = azure-devops-services-git
```

* Check what one Azure DevOps Services Git connection collected.

```
Connections = YOUR_CONNECTION_NAME
```

## Before you begin

### Network

| Source              | Destination   | Port | Protocol |
| ------------------- | ------------- | ---- | -------- |
| OctoXLabs connector | dev.azure.com | 443  | HTTPS    |

### Required permissions

| Scope or role           | Permission | Needed for                   |
| ----------------------- | ---------- | ---------------------------- |
| Code (Read)             | Read       | Repositories and commit data |
| Project and Team (Read) | Read       | Project metadata             |
| User Profile (Read)     | Read       | Identity information         |

The token owner must have at least **Basic Read** access to the Azure DevOps project and repository.

## Create credentials in Azure DevOps Services Git

{% stepper %}
{% step %}

### Sign in

Log in to your Azure DevOps account.
{% endstep %}

{% step %}

### Create a token

Go to **User Settings** > **Personal Access Tokens** and click **New Token**.
{% endstep %}

{% step %}

### Name it

Set a descriptive **Name** and an appropriate **Expiration** date.
{% endstep %}

{% step %}

### Select the organization

Select the required **Organization**.
{% endstep %}

{% step %}

### Set scopes

Under **Scopes** choose **Custom defined** and grant Code (Read), Project and Team (Read) and User Profile (Read).
{% endstep %}

{% step %}

### Copy the token

Click **Create** and copy the token.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                   | Required | Type    | Default | Description                                                                  |
| --------------------------- | -------- | ------- | ------- | ---------------------------------------------------------------------------- |
| Personal Access Token (PAT) | Yes      | String  | None    | Token used for every API request.                                            |
| Organization Name           | Yes      | String  | None    | Name of your organization, the last part of `https://dev.azure.com/<name>/`. |
| Is Secure                   | No       | Boolean | True    | Listed in the form, but the code always uses `https://dev.azure.com`.        |
| Thread Count                | No       | Integer | 32      | Parallel threads. Minimum 1, maximum 32.                                     |
| Sleep Time                  | No       | Integer | 0       | Delay in seconds between thread batches.                                     |

## Troubleshooting

| Error message                                                          | Cause                                                                  | Fix                                                                                                                                           |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| 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

{% hint style="info" %}
Available starting from version 6.0.0.
{% endhint %}
