> ## 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.

<Info>
  For an overview of how CodeRabbit integrates with Git platforms, see [Platform Integration Overview](/platforms/overview).

  For a hands-on tutorial with CodeRabbit performing code reviews on a live repository, see [Quickstart](/getting-started/quickstart).
</Info>

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

<Warning>
  **Required Setup**

  * 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
  * Admin approval permissions for Microsoft Apps consent requests
  * The user installing CodeRabbit must have either of the following permissions:
    * `Project Administrator`
    * `Project Collection Administrator`
</Warning>

## Integration Instructions

<Steps>
  <Step title="Log in to CodeRabbit">
    Navigate to the [CodeRabbit application](https://app.coderabbit.ai) and log
    in with your account.
  </Step>

  <Step title="Handle Microsoft Apps consent">
    You'll be redirected to a page displaying Microsoft Apps consent requests.

    <Warning>
      If you are an administrator, you may approve the applications directly. If
      not, please contact your administrator to request approval for the
      applications.
    </Warning>

    <img
      src="https://mintcdn.com/coderabbit/69LGK0BhaHIxrC15/images/platforms/assets/images/azure_apps_consent_page-0c1b13cf62abe69feff9d0efff1ae384.png?fit=max&auto=format&n=69LGK0BhaHIxrC15&q=85&s=01317bf11a760225cbb33d749a2b6fce"
      alt="CodeRabbit admin consent page for Azure DevOps
integration"
      width="1070"
      height="649"
      data-path="images/platforms/assets/images/azure_apps_consent_page-0c1b13cf62abe69feff9d0efff1ae384.png"
    />
  </Step>

  <Step title="Continue after approval">
    Once your administrator has approved the applications, click **Continue**.
  </Step>

  <Step title="Select your organization">
    You'll be redirected to the "Onboarding" page where you can select the
    organization you wish to integrate with.
  </Step>

  <Step title="Configure Personal Access Token">
    On the "Azure DevOps User" page, enter your Personal Access Token for Azure
    DevOps. <img src="https://mintcdn.com/coderabbit/69LGK0BhaHIxrC15/images/platforms/assets/images/azure_devops_user_page-cca2f1057e479afcdc11a605bc063472.png?fit=max&auto=format&n=69LGK0BhaHIxrC15&q=85&s=9d59c88b0d919cd1324ee9ff6ebbee30" alt="CodeRabbit Azure DevOps integration settings
    page" width="1686" height="1248" data-path="images/platforms/assets/images/azure_devops_user_page-cca2f1057e479afcdc11a605bc063472.png" />
  </Step>

  <Step title="Install on repositories">
    To install CodeRabbit on a repository, toggle the switch on the
    "Repositories" page.
  </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. This token can be generated by creating a Personal Access Token from one of your existing users.

You can create a new user in Azure DevOps and generate a Personal Access Token for that user, following [our recommendations](#recommendations).

## 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.

<img src="https://mintcdn.com/coderabbit/69LGK0BhaHIxrC15/images/platforms/assets/images/azure_personal_access_token_add-ffbefdeb94883745377d71337ab98a45.png?fit=max&auto=format&n=69LGK0BhaHIxrC15&q=85&s=af98419f582d8139dfdfb985cce795f6" alt="CodeRabbit azure devOps integration modal" width="1306" height="1234" data-path="images/platforms/assets/images/azure_personal_access_token_add-ffbefdeb94883745377d71337ab98a45.png" />

### Recommendations

<Check>
  **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")
</Check>

### Key Points to Remember

<Note>
  **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**
</Note>

### 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>

<img src="https://mintcdn.com/coderabbit/69LGK0BhaHIxrC15/images/platforms/assets/images/azure-access-token-178518378ab665a6ee7877d90bd46c06.png?fit=max&auto=format&n=69LGK0BhaHIxrC15&q=85&s=7a3ea58edbfcfe8edee5322489ca7638" alt="CodeRabbit azure devOps personal access token creation form" width="437" height="925" data-path="images/platforms/assets/images/azure-access-token-178518378ab665a6ee7877d90bd46c06.png" />
