Azure DevOps Pull Commits
By enabling the Azure DevOps Pull Commits connector, you can import commits associated with pull requests. Please refer to the API documentation below and our schema explorer to see what data DX imports—note that DX does not read or access your source code.
Before proceeding, please make sure that you have first enabled the Azure DevOps Repositories connector by following the steps here. Azure DevOps Services supports PAT or Microsoft Entra service principal authentication.
Prerequisites
For Azure DevOps Services (cloud), use a personal access token (PAT) or a Microsoft Entra service principal with a client secret or certificate. Azure DevOps Server supports PAT authentication only.
Setup instructions
Follow the steps below to connect Azure DevOps Pull Commits to DX.
Microsoft Entra service principal (Azure DevOps Services)
For Azure DevOps Services (cloud), follow the Microsoft Entra authentication setup guide and configure this connector in DX. Azure DevOps Server supports PAT authentication only.
Data connection with a PAT
The instructions and scopes below apply only to PAT credentials.
Step 1
- Go to the Azure portal and create a service account in Microsoft Entra ID (formerly Azure Active Directory).
- Then, assign the service account to an ADO organization and grant them permissions.
- See Add organization users and manage access and Security groups, service accounts, and permissions reference for more information.
Step 2
- Log into ADO using the service account
- Generate a Personal Access Token with the read permissions outlined below:
| Permissions |
|---|
| - Code (read) |
Step 3
- Navigate to the connections page in DX and select “+ Connection” in the top right.
- Enter the credentials you have generated in the previous steps—refer to the information below for errors and troubleshooting.
API reference
The table below lists the specific API endpoints that are used by DX.
| Endpoint | Documentation |
|---|---|
| /graph/users | Link |
| /projects | Link |
| /projects/{projectId}/teams | Link |
| /projects/{projectId}/teams/{teamId}/members | Link |
| /git/repositories/{repoId}/pullrequests/{id}/commits | Link |
Curl commands
When DX verifies an Azure DevOps Pull Commits connection, it checks specific endpoints to ensure proper access. The curl commands below use a PAT. For Entra credentials, verify in DX or use an access token with an Authorization: Bearer header, as in Microsoft’s Azure DevOps token guide.
Replace YOUR_ORGANIZATION and YOUR_PAT with your actual values before running these commands.
1. Test Project Access
This verifies that your service account can access project information:
curl -u :YOUR_PAT -H 'Accept: application/json' 'https://dev.azure.com/YOUR_ORGANIZATION/_apis/projects?api-version=7.0'
2. Test User Access
This verifies that your service account can access user information:
curl -u :YOUR_PAT -H 'Accept: application/json' 'https://dev.azure.com/YOUR_ORGANIZATION/_apis/graph/users?api-version=7.0'
3. Test Pull Request Commits
Replace YOUR_PROJECT_ID and YOUR_REPO_ID with valid IDs, and YOUR_PULL_REQUEST_ID with a valid pull request ID to verify pull request commits access:
curl -u :YOUR_PAT -H 'Accept: application/json' 'https://dev.azure.com/YOUR_ORGANIZATION/_apis/git/repositories/YOUR_REPO_ID/pullRequests/YOUR_PULL_REQUEST_ID/commits?api-version=7.0'
If you receive a 401 Unauthorized error, your credentials are invalid. If you receive a 403 Forbidden error, your token doesn’t have the required permissions. If you receive a 404 Not Found error or empty results, check that your organization name is correct.
Note about Authentication: The -u :YOUR_PAT flag uses curl’s built-in basic authentication with an empty username and your Personal Access Token as the password. This automatically handles the Base64 encoding required for Azure DevOps authentication.
Errors
The table below lists potential error codes when adding a connection in DX.
| Error | Description |
|---|---|
invalid_credentials |
Your API credentials entered are not valid. |
invalid_permissions |
Your API token does not have the permissions required by DX. |
no_resources |
DX cannot access any projects or repositories. |
Data Cloud API
Once the initial connection is created successfully, credentials can be managed via the Data Cloud API. This connector uses the same credential fields as Azure DevOps Repositories for PAT, client secret, and certificate authentication.