|
| 1 | +--- |
| 2 | +title: Integrating CodeRabbit with Azure DevOps |
| 3 | +description: Learn how to integrate CodeRabbit with Azure DevOps. |
| 4 | +sidebar_label: Azure DevOps |
| 5 | +sidebar_position: 5 |
| 6 | +--- |
| 7 | + |
| 8 | +import InfoBox from "../../src/components/InfoBox" |
| 9 | +import ListItems from "../../src/components/ListItems" |
| 10 | +import { Warning } from "../../src/components/Warning" |
| 11 | + |
| 12 | +This guide will assist you in effectively integrating CodeRabbit with Azure DevOps. |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +<ListItems |
| 17 | + items={[ |
| 18 | + "An active Azure DevOps account", |
| 19 | + "Use of organizational email addresses is required; personal email addresses are not supported for this integration" |
| 20 | + ]} |
| 21 | +/> |
| 22 | + |
| 23 | +## Integration Instructions |
| 24 | + |
| 25 | +<ListItems |
| 26 | + orderedList |
| 27 | + items={[ |
| 28 | + <>Log in to the CodeRabbitAI application</>, |
| 29 | + <>After logging in, you will be redirected to a page displaying Microsoft Apps consent requests. Please forward these requests to your administrator for approval. |
| 30 | + |
| 31 | + <Warning> |
| 32 | + If you are an administrator, you may approve the applications directly. If not, please contact your administrator to request approval for the applications. |
| 33 | + </Warning> |
| 34 | + |
| 35 | + <img src="/img/integrations/azure_apps_consent_page.png" alt="CodeRabbit admin consent page for Azure DevOps integration" style={{border: '1px solid #e0e0e0', borderRadius: '4px'}} /></>, |
| 36 | + <>Once your administrator has approved the applications, click "Continue"</>, |
| 37 | + <>You will be redirected to the "Onboarding" page, where you can select the organization you wish to integrate with</>, |
| 38 | + <>On the "Azure DevOps User" page, enter your Personal Access Token for Azure DevOps. |
| 39 | + |
| 40 | + <img src="/img/integrations/azure_devops_user_page.png" alt="CodeRabbit azure devOps integration settings page" style={{border: '1px solid #e0e0e0', borderRadius: '4px'}} /></>, |
| 41 | + <>To install CodeRabbit on a repository, toggle the switch on the "Repositories" page</> |
| 42 | + ]} |
| 43 | +/> |
| 44 | + |
| 45 | +## How it works |
| 46 | + |
| 47 | +For the CodeRabbit app to post reviews on merge 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. |
| 48 | + |
| 49 | +You can create a new user in Azure DevOps and generate a Personal Access Token for that user, following [our recommendations](#recommendations). |
| 50 | + |
| 51 | +## Azure DevOps Personal Access Tokens |
| 52 | + |
| 53 | +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. |
| 54 | + |
| 55 | +Upon first login to the application (immediately after the onboarding screen), you will need to add the Personal Access Token. |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +### Recommendations |
| 60 | + |
| 61 | +<ListItems |
| 62 | + items={[ |
| 63 | + <><strong>Create a dedicated user for CodeRabbit</strong> - This ensures the user is exclusively for CodeRabbit, allowing better access control</>, |
| 64 | + <><strong>Use "CodeRabbit" as the username</strong> - This makes the user easily recognizable for future reference</>, |
| 65 | + <><strong>Use a dedicated email address</strong> - This helps in easy identification and management</>, |
| 66 | + <><strong>Use the CodeRabbit logo as the profile picture</strong> - This further ensures easy recognition. You can download our logo from <a href="/img/integrations/logo.png">here</a></> |
| 67 | + ]} |
| 68 | +/> |
| 69 | + |
| 70 | +### Key Points to Remember |
| 71 | + |
| 72 | +<ListItems |
| 73 | + items={[ |
| 74 | + <>Personal access tokens have expiration dates. Ensure the expiration date covers the duration of your intended use of the CodeRabbit app</>, |
| 75 | + <>Code reviews will be attributed to the owner of the personal access token</>, |
| 76 | + <>If the personal access token expires, you can add a new one via the CodeRabbit UI: |
| 77 | + <ListItems |
| 78 | + nested |
| 79 | + items={[ |
| 80 | + <>Navigate to the "AzureDevOps User" page in the sidebar</>, |
| 81 | + <>Add the new token and click save</> |
| 82 | + ]} |
| 83 | + /></> |
| 84 | + ]} |
| 85 | +/> |
| 86 | + |
| 87 | +### Generating a Personal Access Token |
| 88 | + |
| 89 | +Azure DevOps provides an option to generate a personal access token for a user. Follow these steps to generate the token: |
| 90 | + |
| 91 | +<ListItems |
| 92 | + orderedList |
| 93 | + items={[ |
| 94 | + <>Log in as the user intended for CodeRabbit reviews</>, |
| 95 | + <>Next to your avatar on the headers right side is a settings icon, click it</>, |
| 96 | + <>Choose "Personal Access Tokens"</>, |
| 97 | + <>Click "New Token"</>, |
| 98 | + <>Select the organization you want to use the token with or select "All accessible organizations"</>, |
| 99 | + <>Enter a name and an expiry date for the token</>, |
| 100 | + <>We need to have read & write access to "Work Items" & "Code" to post reviews on pull requests. If you are on the Pro tier also add "Build" access for pipeline failure remediation</>, |
| 101 | + <>Click "Create"</> |
| 102 | + ]} |
| 103 | +/> |
| 104 | + |
| 105 | + |
0 commit comments