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

# Azure DevOps

> Learn how to integrate CodeRabbit with Azure DevOps repositories using personal access tokens for automated AI-powered code reviews and pull request analysis.

<Warning>
  **Only Azure DevOps administrators can set up this integration.** Before you begin, confirm that you have either `Project Administrator` or `Project Collection Administrator` permissions in Azure DevOps. If you don't, ask an administrator to complete the setup. See [Prerequisites](#prerequisites) for the full list of requirements.
</Warning>

CodeRabbit enhances your Azure DevOps development workflow by providing:

* **Automated code reviews** for newly created pull requests
* **AI-powered suggestions** displayed directly on pull requests
* **Interactive assistance** through the CodeRabbit bot for real-time feedback
* **Seamless integration** with your existing Azure DevOps workflow

<Info>
  To interact with CodeRabbit in pull request comments, use `@coderabbitai` — or the username of the service account you configure below, if it differs.
</Info>

## Prerequisites

* The user installing CodeRabbit must have `Project Collection Administrator` permissions
* Admin approval permissions for Microsoft Apps consent requests
* Entra ID must be enabled for the organization
* An active Azure DevOps account
* Organizational email addresses are required; personal email addresses are not supported for this integration

## Integration Instructions

Complete the setup in the following order. The first three steps happen in Azure DevOps; the last two happen in the CodeRabbit application.

### Azure DevOps configuration

<Steps>
  <Step title="Confirm you are an administrator">
    Before doing anything else, verify that your Azure DevOps account has either
    `Project Administrator` or `Project Collection Administrator` permissions.
    Only administrators can complete this integration. If you don't have these
    permissions, ask an administrator to perform the setup. See
    [Prerequisites](#prerequisites) for the complete list of requirements.
  </Step>

  <Step title="Create a dedicated service account">
    In Azure DevOps, create a new user to act as a dedicated service account for
    CodeRabbit. Using a separate account—rather than a personal one—gives you
    better access control and makes CodeRabbit's activity easy to recognize. See
    [Recommendations](#recommendations) for naming and configuration best
    practices.
  </Step>

  <Step title="Generate a Personal Access Token for the service account">
    Logged in as the service account, generate a Personal Access Token (PAT).
    CodeRabbit uses this token to interact with the Azure DevOps API on behalf of
    the service account. Follow the detailed steps in
    [Generating a Personal Access Token](#generating-a-personal-access-token),
    then save the token securely—it is only displayed once.
  </Step>
</Steps>

### CodeRabbit configuration

<Steps>
  <Step stepNumber="4" title="Configure the integration">
    Return to the [CodeRabbit application](https://app.coderabbit.ai) and log in
    with your account. You'll be redirected to a page displaying Microsoft Apps
    consent requests.

    <Frame caption="CodeRabbit admin consent page for Azure DevOps integration">
      <img src="https://mintcdn.com/coderabbit/qjqObqp38w4iXzp3/assets/images/azure-devops-apps-consent-page.png?fit=max&auto=format&n=qjqObqp38w4iXzp3&q=85&s=bcc84f9687a00ed84f2d3b7cbe544e03" alt="CodeRabbit admin consent page for Azure DevOps integration" width="1070" height="649" data-path="assets/images/azure-devops-apps-consent-page.png" />
    </Frame>

    Once the applications are approved, click **Continue**. On the "Onboarding"
    page, select the organization you wish to integrate with. Then, on the "Azure
    DevOps User" page, enter the Personal Access Token you generated for the
    service account.

    <Frame caption="CodeRabbit Azure DevOps integration settings page">
      <img src="https://mintcdn.com/coderabbit/qjqObqp38w4iXzp3/assets/images/azure-devops-user-page.png?fit=max&auto=format&n=qjqObqp38w4iXzp3&q=85&s=e8fdc4d695692d1d55271282f280b571" alt="CodeRabbit Azure DevOps integration settings page" width="1686" height="1248" data-path="assets/images/azure-devops-user-page.png" />
    </Frame>
  </Step>

  <Step stepNumber="5" title="Install CodeRabbit on your repositories">
    To install CodeRabbit and its webhooks on a repository, toggle the switch on
    the "Repositories" page. This registers the webhooks CodeRabbit needs to
    receive pull request events.
  </Step>
</Steps>

## How it works

For the CodeRabbit app to post reviews on pull requests, it needs to interact with the Azure DevOps API, which requires a Personal Access Token.

We recommend creating a dedicated service account in Azure DevOps and generating the Personal Access Token for that account, following [our recommendations](#recommendations). Generating the token from a dedicated account—rather than a personal one—keeps CodeRabbit's access scoped and its activity easy to identify.

## Azure DevOps for Enterprise SSO workspaces

Enterprise SSO workspaces can connect Azure DevOps during workspace onboarding or from workspace provider settings. When prompted, sign in with a work account, or choose **Use a specific tenant** to connect against a tenant GUID or domain such as `contoso.onmicrosoft.com`.

For Multi-Org Azure DevOps rollouts, configure one workspace-level Azure DevOps personal access token for the dedicated CodeRabbit service user. Open the Azure DevOps user settings in CodeRabbit, then save a workspace personal access token scoped to the Azure DevOps organizations attached to the workspace.

The workspace token should have access to every Azure DevOps organization attached to the workspace, with **Code** read and write access and **Pull Request** scopes. CodeRabbit stores the token encrypted. PR Review prefers the workspace token across the linked Azure DevOps organizations and uses an organization-level token only as a fallback when the workspace token is missing or unusable.

<Warning>
  Pull requests opened by the dedicated service user are not reviewed by CodeRabbit, because the reviewer cannot review its own pull requests.
</Warning>

## Azure DevOps Personal Access Tokens

To interact with the Azure DevOps API, a **Personal Access Token** is required. This token can be generated by creating a **Personal Access Token** from one of your existing users.

Upon first login to the application (immediately after the onboarding screen), you will need to add the Personal Access Token.

<Frame caption="CodeRabbit Azure DevOps integration modal">
  <img src="https://mintcdn.com/coderabbit/qjqObqp38w4iXzp3/assets/images/azure-devops-personal-access-token-add.png?fit=max&auto=format&n=qjqObqp38w4iXzp3&q=85&s=487e959faf1d3865c7ef05187f393e14" alt="CodeRabbit Azure DevOps integration modal" width="1306" height="1234" data-path="assets/images/azure-devops-personal-access-token-add.png" />
</Frame>

### Recommendations

**Best Practices for Azure DevOps Integration:**

* **Create a dedicated user for CodeRabbit** - This ensures the user is exclusively for CodeRabbit, allowing better access control
* **Use "CodeRabbit" as the username** - This makes the user easily recognizable for future reference
* **Use a dedicated email address** - This helps in easy identification and management
* **Use the CodeRabbit logo as the profile picture** - This further ensures easy recognition. You can download our logo from [here](https://www.coderabbit.ai/brand "download")

### Generating a Personal Access Token

Azure DevOps provides an option to generate a personal access token for a user. Follow these steps to generate the token:

<Steps>
  <Step title="Log in to Azure DevOps">
    Log in as the user intended for CodeRabbit reviews.
  </Step>

  <Step title="Access Personal Access Tokens">
    Next to your avatar on the header's right side is a settings icon, click it,
    then choose **Personal Access Tokens**.
  </Step>

  <Step title="Create new token">Click **New Token**.</Step>

  <Step title="Configure token scope">
    Select the organization you want to use the token with or select **All
    accessible organizations**.
  </Step>

  <Step title="Set token details">
    Enter a name and an expiry date for the token.
  </Step>

  <Step title="Grant permissions">
    Grant the following permissions:

    * **Read, write, & manage** access to **Work Items** and **Code** (required for code reviews)
    * **Read** access to **Build** (optional, for CodeRabbit Pro pipeline failure remediation)
  </Step>

  <Step title="Create and save token">
    Click **Create** and save the generated token securely as it will only be
    displayed once.
  </Step>
</Steps>

**Token Management:**

* Personal access tokens have expiration dates. Ensure the expiration date covers the duration of your intended use of the CodeRabbit app
* Code reviews will be attributed to the owner of the personal access token
* If the personal access token expires, you can add a new one via the CodeRabbit UI:
  * Navigate to the **Azure DevOps User** page in the sidebar
  * Add the new token and click **Save**

<Frame caption="CodeRabbit Azure DevOps personal access token creation form">
  <img src="https://mintcdn.com/coderabbit/qjqObqp38w4iXzp3/assets/images/azure-devops-access-token-form.png?fit=max&auto=format&n=qjqObqp38w4iXzp3&q=85&s=e781c4c1c1a148f6194ff9e2edf07d9f" alt="CodeRabbit Azure DevOps personal access token creation form" width="437" height="925" data-path="assets/images/azure-devops-access-token-form.png" />
</Frame>

## What's next

<CardGroup cols={1}>
  <Card title="Quickstart" href="/getting-started/quickstart" icon="rocket" horizontal>
    Open your first pull request and watch CodeRabbit post an automated review in minutes.
  </Card>

  <Card title="Configure CodeRabbit" href="/getting-started/yaml-configuration" icon="settings" horizontal>
    Customize review behavior, language settings, and rules for your Azure DevOps repositories.
  </Card>

  <Card title="Code review overview" href="/guides/code-review-overview" icon="search" horizontal>
    Learn how CodeRabbit reviews your pull requests and delivers actionable feedback.
  </Card>
</CardGroup>
