> For the complete documentation index, see [llms.txt](https://docs.nullify.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nullify.ai/enterprise-tier/azure-install.md).

# Azure DevOps Install

## Creating the Azure App

1. **Sign in to Azure Portal:**
   * Go to [Azure Portal](https://portal.azure.com/).
   * Sign in with your Azure account credentials.
2. **Register a New Application:**
   * In the Azure Portal, select **App registrations**.
   * Click on the **+ New registration** button at the top of the App registrations page.

<figure><img src="/files/bDaEMbSLcL8OILsBmjVe" alt=""><figcaption><p>New App Registration</p></figcaption></figure>

3. **Enter Application Details:**
   * **Name:** Enter a name for your application ("Nullify").
   * **Supported Account Types:** Choose the option for who can use the application:
     * Accounts in this organizational directory only (single tenant)
4. **Register the Application:**
   * Click **Register** to create the application. This action will register the application with Azure and generate a unique Application (client) ID and Directory (tenant) ID.
   * Record the `client_id` and `tenant_id`.

<figure><img src="/files/e3voHd79XRdwv4WBF7bC" alt=""><figcaption><p>Client ID and Tenant ID</p></figcaption></figure>

6. **Create Client Secret:**

   * In the left-hand menu of your app's registration page, select **Certificates & secrets**.
   * Under **Client secrets**, click on **New client secret**.

   <figure><img src="/files/zAmv6bgk3K8qSZQSNK8v" alt=""><figcaption><p>New client secret</p></figcaption></figure>

   * Provide a description for the secret (e.g., "Nullify App") and select an expiration period (e.g., 6 months, 12 months, 24 months).
   * Click **Add**.
   * After creating the client secret, it will be displayed only once. Make sure to copy and securely store this value immediately. This is your `client_secret`. Make sure you copied the secret value and not the secret id.

   <figure><img src="/files/8G4giE0rw5P3wYyXsVKS" alt=""><figcaption><p>Client Secret Value</p></figcaption></figure>
7. **Configure API Permissions:**

   * Nullify authenticates to Azure DevOps with the **client credentials** flow, using the Client ID, Client Secret, and Tenant ID you provide below. It requests the Azure DevOps `.default` scope, which grants access to the Azure DevOps API surface.
   * Go to **API Permissions** in the left menu.
   * Click **+ Add a permission** and select **APIs my organization uses**.
   * Search for and select **Azure DevOps**.
   * Add the `user_impersonation` permission, then click **Add permissions**.

   <figure><img src="/files/cuaFkIZgBXuHo6IuHZeO" alt=""><figcaption><p>Azure DevOps Application Permission</p></figcaption></figure>

   * Grant admin consent for Default Directory

   <figure><img src="/files/XZp1qqRAYV3diXLis926" alt=""><figcaption><p>Admin Consent</p></figcaption></figure>
8. **Authentication**

   * In the left menu, click on **Authentication**.
   * Under Platform configurations click \`\`+ Add a platform\` and choose **Web** application.
   * Under Web Redirect URIs, add the redirect URI that Nullify provides for your tenant (your Nullify representative will give you the exact value).

   <figure><img src="/files/62O45aXpEPV3nAKT3bT5" alt=""><figcaption><p>Authentication Redirect URI</p></figcaption></figure>
9. **Provide Credentials to Nullify**

Please provide Nullify with the following credentials to complete your installation:

* **Client ID**
* **Client Secret**
* **Tenant ID**

## Add the Nullify App to your DevOps Organization

1. **Add Nullify as a User:**
   * Go to your Azure DevOps organization.
   * Navigate to **Organization settings**.
   * Select **Users** from the left-hand menu.
   * Click on **Add users**.
   * In the search box, type "Nullify" and select the Nullify service principal.
   * Set the **Access Level** to **Basic**.
   * Note: If you encounter an error saying "can't be added at this time," keep trying as it may be a temporary glitch.

<figure><img src="/files/eYtGUpNvhtQ9W1h22QzQ" alt=""><figcaption><p>Add Nullify (Service Principal) as a user</p></figcaption></figure>

## Configure Webhooks for Azure DevOps

The Nullify Dashboard can create all the necessary webhooks needed. You can do this across the whole organization or at the repository level. You can also create the webhooks manually.

### Automatic webhook creation

1. **Give Nullify permissions to create webhooks** Add the Nullify Service Principal User as an Administrator to your Azure DevOps organization. (This can be temporary until after the webhooks are created.)
   * Go to the **Project Settings** of the project you want to create webhooks for.
   * Navigate to **Permissions**.
   * Add the Nullify service principal to the **Project Collection Administrators** group.

<figure><img src="/files/Fha2hLhJAU5sq1pApdZi" alt=""><figcaption><p>Add Nullify to the Project Collection Administrator group</p></figcaption></figure>

2. **Create webhooks via the Nullify dashboard**

* Log in to your Nullify dashboard (<https://app.your-company.nullify.ai>)
* Option 1: Creating webhooks across the organization.

  * Go to the **Configure** tab and under the Info menu, click on **Initialize Azure Webhooks**.

  <figure><img src="/files/DtiyjZCOKwzgpl2MSMkY" alt=""><figcaption><p>Add Nullify to the necessary permission groups</p></figcaption></figure>
* Option 2: Creating webhooks per repo

  * Go to the **Configure** tab and under the **Repositories** menu, you will see a list of repositories with the column **Is Initialized?**
  * This column indicates whether webhooks have been configured for that repository.
  * Click on the **Initialize** button to create webhooks.

  <figure><img src="/files/pt67zIaJGTl9F0O9RFYg" alt=""><figcaption><p>Repositories configuration</p></figcaption></figure>

3. You may now remove administrator privilages for Nullify from the DevOps organization.

### Manual webhook creation

1. **Create a Service Hook Subscription:**
   * Go to your Azure DevOps organization.
   * Navigate to the project where you want to configure the webhook.
   * Select **Project Settings** from the bottom left corner.
   * Under **General**, select **Service hooks**.
   * Click on **+ Create subscription**.
2. **Select the Service:**
   * In the list of services, select **Web Hooks**.
   * Click **Next**.
3. **Configure the Trigger:**
   * Choose the following events that will trigger the webhook: Code Pushed, Pull request commented on, Pull Request created, Pull Request updated, Work item updated. Azure only allows one event to be selected at a time so you will need to do steps 1-4 for each event type.
   * Click **Next**.
4. **Configure the Action:**
   * Enter the **URL** of the webhook endpoint provided by Nullify.
   * The URL is of the form `https://api.<your-organization>.nullify.ai/core/azure/webhook`
   * Basic authentication username is `nullify`.
   * Basic authentication password is the webhook shared secret provided to you by Nullify.
   * Click **Finish** to create the webhook subscription.

<figure><img src="/files/yZ1Idw8X40taELsYWHRy" alt=""><figcaption><p>Webhook creation</p></figcaption></figure>
