> For the complete documentation index, see [llms.txt](https://docs.hivel.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hivel.ai/integrations/version-control/azure/azure-devops-cloud-recommended.md).

# Azure Devops - Cloud (recommended)

To connect Azure DevOps to Hivel using a Personal Access Token (PAT), follow these steps:

**Data Access by Hivel**

* Hivel accesses the past 30-90 days of commits and pull requests from active repositories during the initial sync.

**Authorization Mechanism**

* Hivel gets access using a Personal Access Token, which can be created using this [open the API tokens page](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops\&tabs=Windows#create-a-pat).
* Users maintain full control and can withdraw access anytime by revoking the Personal Access Token.

**Requirements**

* Ensure to create the Personal Access Token from an account that has "Project Administrator" permissions for all relevant projects and repositories.

**Best Practice**

* Opt for a service account rather than an individual-linked account.
* Service accounts are typically overseen by the company's admin.

### **Steps to integrate Azure DevOps with PAT**

#### **Step 1: Prepare a Service Account**

1. **Log into the Azure DevOps service account:**
   * Use a dedicated service account that has "Project Administrator" permissions for the projects and repositories Hivel should analyze.
   * Avoid using personal accounts to ensure only the intended projects are accessed.

#### **Step 2: Create the Personal Access Token**

1. Click on the **user settings** on the top right corner to the left of the profile icon.

<img src="/files/XZpys5Gv5czcF4i4csYZ" alt="" height="401" width="679">

1. Create a new Personal Access Token in Azure DevOps.

<img src="/files/crw14IDKPavwhYvYFZlF" alt="" height="360" width="301">

1. Enter *Hivel* as the token name.
2. Ensure **'All accessible organizations'** is selected while creating the Personal Access Token.
3. Set the expiration to the **longest period your organization's policy allows**. (You can revoke the token manually when the engagement ends.)

![](/files/Ja7bhPhmQYSl1aoL96OL)

&#x20;            Set the scope to Custom Defined.

5. Please ensure you select all the permissions below -**all Read**:
   * **Project And Team:** Read
   * **User Profile:** Read
   * **Code:** Read
   * **Work Items:** Read
6. Create the token and **copy it immediately**, as you won't be able to view it again.

#### Step 3: Connect in Hivel

1. **Copy the generated token** immediately, as you won't be able to view it again.
2. Submit the token to Hivel.

Hivel validates the token instantly - if the token is wrong, expired, or revoked, Hivel shows a clear message telling you exactly what the problem is. Generate a new token with the correct permissions and reconnect.

That's it, all done!
