> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fullotto.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure DevOps

> Connect Azure Repos with Otto's service principal and choose which repositories Otto reviews.

Otto accesses Azure DevOps through a service principal (an application identity) that you add to your Azure DevOps organization.

## Prerequisites

* An Azure DevOps organization
* Admin access to its organization settings, to add the service principal
* Your Microsoft Entra **Tenant ID** (Azure Portal → **Microsoft Entra ID → Overview**)

## Connect Azure Repos

<Steps>
  <Step title="Add Otto's service principal">
    1. In Azure DevOps, go to **Organization Settings → Users → Add users**.
    2. Search for Otto's service principal by app name or client ID.
    3. Set its access level to **Basic**.
    4. Add it to the projects Otto should review as a **Contributor**.
  </Step>

  <Step title="Connect in Otto">
    1. In Otto, go to **Settings → Integrations** and click **Connect** on the Azure Repos card.
    2. Enter your Azure DevOps organization name (from `https://dev.azure.com/<organization>`).
    3. Enter your Tenant ID and click **Connect**.

    Otto validates its access and creates the webhook subscriptions it needs for pull request events.
  </Step>

  <Step title="Choose repositories">
    Choose which repositories Otto should review. You can prune them later in **Settings → Integrations**.
  </Step>
</Steps>

## Permissions

The service principal needs:

| Permission | Why |
| - | - |
| **Code** (read/write) | Read code and `otto.yml`; push ticket work |
| **Pull requests** (read/write) | Post reviews, votes, and replies |
| **Work items** (read/write) | Link pull requests to work items |
| **Identity** (read) | Resolve users and teams |

Otto subscribes to these events automatically:

| Event | Used for |
| - | - |
| PR created | Starting a review |
| PR updated | Re-reviewing after new commits |
| PR comment | Commands and replies to Otto |

## How reviews appear

Otto records its verdict as its reviewer vote (approve, or wait for author) and posts a summary thread and inline threads on every review. It also posts an `otto/review` status that tells you whether Otto is still reviewing. See [Merge gates](/setup/merge-gates#azure-repos-the-otto/review-status) to require it.

## Troubleshooting

<AccordionGroup>
  <Accordion title="&#x22;Failed to validate access&#x22;">
    The service principal isn't in your Azure DevOps organization or lacks
    access. Go to **Organization Settings → Users → Add users**, add Otto's
    service principal, and grant it **Basic** access.
  </Accordion>

  <Accordion title="&#x22;Tenant ID not found&#x22; or a token error">
    The Tenant ID is probably wrong. Copy it again from **Microsoft Entra ID →
    Overview** in the Azure Portal.
  </Accordion>

  <Accordion title="Otto doesn't react to pull requests">
    Otto creates webhook subscriptions when you connect. If that failed, Otto
    still connects but receives no PR events. Disconnect and reconnect the
    integration, or contact support.
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.