---
title: Azure DevOps Source Code
description: >-
  Azure DevOps is a web-based hosting service for software development projects
  that use the Git revision control system.
breadcrumbs: Docs > Integrations > Azure DevOps Source Code
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Azure DevOps Source Code
Integration version1.0.0
{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Overview{% #overview %}

Integrate Datadog with your Azure DevOps repositories to streamline troubleshooting of code issues and get suggested changes on your source code.

Get context-relevant code snippets while investigating issues in Error Tracking, Continuous Profiler, Code Security, and many more areas within Datadog.

Protect your production code base with pull request comments from Code Security, Test Optimization, and CI Visibility that provide automated code reviews and suggested changes.



### Source code functionality{% #source-code-functionality %}

When installed with the correct permissions, this integration powers [source code integration](https://docs.datadoghq.com/integrations/guide/source-code-integration.md) features across Datadog to help you troubleshoot and take action on your code:

- See code snippets in your stack traces to identify where code problems originate. This can speed up investigations in Error Tracking, Continuous Profiler, Dynamic Instrumentation, and Live Debugger.
- Streamline code reviews with automated feedback and suggested changes from [Code Security](https://docs.datadoghq.com/security/code_security/dev_tool_int/github_pull_requests.md) and [Test Optimization](https://docs.datadoghq.com/continuous_integration/guides/pull_request_comments.md), posted directly on pull requests.

### Azure DevOps pipelines{% #azure-devops-pipelines %}

For more in-depth monitoring of your Azure DevOps Pipelines, check out [CI Pipeline Visibility](https://app.datadoghq.com/ci/getting-started). CI Pipeline Visibility provides granular insights into your user workflow, lets you access detailed Git metadata, and tracks pipeline performance over time.

## Setup{% #setup %}

{% alert level="info" %}
You must have the Integrations Manage permission in Datadog and be an admin of your Azure portal to install this integration. Some features require additional setup beyond installing the Azure DevOps Source Code integration. Installing the integration connects your Azure DevOps projects and repositories to Datadog and grants only the permissions and access required as prerequisites for supported features. It doesn't enable any billable functionality by default, and you only incur additional charges if you explicitly configure a paid feature.
{% /alert %}

{% alert level="warning" %}
To use this integration, you must be using the cloud version of Azure DevOps, and your Azure DevOps organizations must be connected to a Microsoft Entra tenant. Azure DevOps Server is **not** supported.
{% /alert %}

### Connect Microsoft Entra app{% #connect-microsoft-entra-app %}

1. In the [Azure DevOps Source Code integration tile](https://app.datadoghq.com/integrations/azure-devops-source-code/), navigate to the **Configuration** tab.
1. Click **Connect Microsoft Entra App**.
1. Under **Register an Entra App**, click the link to go to the Azure portal and create a new App Registration with these settings:
   - The supported account types must be **Accounts in this organizational directory only (Single tenant)**.
   - Set the Redirect URI platform to **Web**, then copy and paste the callback URL from the Datadog UI into the field.
1. Paste the App Registration's **Application (client) ID** and **Directory (tenant) ID** into the respective fields in Datadog.
1. Follow the link to the **Application API Client Secrets** page in the Azure portal to create a new client secret. Copy the string in the Value column of the client secret table and paste it into the **Value** field in Datadog.
1. Follow the link to the **API Permissions** page in the Azure portal, click **Add a permission**, then select **Azure DevOps** and add the following permissions:
   - `vso.build`
   - `vso.profile`
1. Click **Save Configuration and Continue** to finish registering your Microsoft Entra App and continue to connect your Azure DevOps organizations.

### Connect Azure DevOps organizations{% #connect-azure-devops-organizations %}

After you have registered your Microsoft Entra App, you can connect any number of Azure DevOps organizations to Datadog as long as they are connected to the same Microsoft Entra tenant you used to register the app earlier.

1. Under **Add Service Principal**, enter the URL of your Azure DevOps organization in the **Organization URL** field.
1. Follow the link to the **Organization Settings** page in the Azure portal to invite users to your organization.
1. Click **Add users**, and select the Service Principal belonging to the Microsoft Entra App you registered earlier. This Service Principal must be invited with the following:
   - Access level: Basic
   - Add to projects: Select your relevant projects
   - Azure DevOps Groups: Project Contributors or an equivalent custom group with the following permissions:
     - Contribute
     - Contribute to pull requests
     - Create branch
     - Read
1. Click **Add Organization**.
1. Under **Setup Service Hooks**, click **Grant Edit Permissions**, then sign in with an Azure DevOps account that is a **Project Collection Administrator** of the organization and approve the consent request. The consent grants the Service Principal **Edit** permissions on the Service Hooks Security Namespace. Datadog then configures service hooks automatically on your connected projects, including projects you invite the Service Principal to later.
1. Click **Finish**.

The consent request asks for the **Security (manage)** scope (`vso.security_manage`). Datadog uses this scope only to grant the Service Principal Edit permissions on the Service Hooks Security Namespace. The scope is not added to your Microsoft Entra App. You can revoke this consent in Azure DevOps after setup without affecting service hooks that are already configured.

If you connected your organization before automatic setup was available, click **Grant Edit Permissions** on the **Configuration** tab of the [Azure DevOps Source Code integration tile](https://app.datadoghq.com/integrations/azure-devops-source-code/) to switch to automatic setup.

After setup, you're returned to your original location in Datadog. To enable inline code snippets in APM, [set up Source Code Integration](https://docs.datadoghq.com/integrations/guide/source-code-integration.md).

### Set up service hooks manually{% #set-up-service-hooks-manually %}

If you can't grant the Service Principal Edit permissions, you can create the service hooks yourself. Service hooks created this way cover only the projects that exist when you run the script.

1. Under **Setup Service Hooks**, expand **Setup manually instead**.
1. Under **Select a Datadog API Key**, choose an existing API key or create a new one. The service hooks send this key in their request headers.
1. Create an Azure DevOps Personal Access Token (PAT) with the **Code (Read)** and **Build (Read)** scopes.
1. Under **Run the setup script**, copy the PowerShell or Python command, set the PAT and the Datadog API key in it, and run it in your own terminal. The [service hooks script](https://github.com/DataDog/azdevops-sci-hooks) creates the service hooks on all the projects in your Azure DevOps organization.
1. Click **Finish**.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

Azure DevOps Source Code does not include any metrics.

### Events{% #events %}

Azure DevOps Source Code does not include any events.

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
