Microsoft Entra workload identity for Azure DevOps
If you want a truly secretless alternative to personal access tokens (PATs), use Microsoft Entra workload identity federation. It removes long-lived credentials from the integration, so there is no PAT or client secret to create, store, rotate, or revoke when an employee leaves. During setup:- You provide the UUID of the Microsoft Entra tenant connected to your Azure DevOps organization.
- A tenant administrator grants consent to the CodeAnt Azure DevOps Integration application.
- Microsoft Entra creates a service principal for CodeAnt in your tenant automatically.
- An Azure DevOps administrator adds that service principal to the required projects.
- CodeAnt validates the access before saving the organization.
You do not create a separate app registration, client secret, certificate, Azure DevOps service connection, or bot user for this flow. CodeAnt uses its existing multi-tenant application and exchanges its workload identity for short-lived Microsoft Entra access tokens.
Prerequisites
Before you begin, make sure you have:- An Azure DevOps Services organization, such as
https://dev.azure.com/my-organization. This flow does not support self-hosted Azure DevOps Server. - CodeAnt administrator access to Settings → Add AD org.
- A Microsoft Entra administrator who can grant tenant-wide admin consent. Depending on the permissions shown in the consent screen, this is typically a Cloud Application Administrator, Application Administrator, Privileged Role Administrator, or an equivalent custom role.
- An Azure DevOps Organization Owner or Project Collection Administrator who can add organization users and assign project access.
- The names of the Azure DevOps projects that CodeAnt should access.
Step 1: Find the tenant UUID
The UUID requested by CodeAnt is your Microsoft Entra Directory (tenant) ID. It has this format:From the Azure portal
- Sign in to the Azure portal.
- Open Microsoft Entra ID.
- Select Properties.
- Copy the value labeled Tenant ID.
From Azure CLI
tenantId for the directory connected to your Azure DevOps organization.
Step 2: Start the connection in CodeAnt
- Sign in to CodeAnt AI.
- Open Settings → Add AD org.
- Select Add AD org.
- Enter the following values:
- Select Grant admin consent.
If the consent prompt says that administrator approval is required, send the setup to one of the Microsoft Entra administrators listed in the prerequisites. A regular Azure DevOps administrator might not have permission to grant tenant consent.
Step 3: Verify the service principal in Microsoft Entra
Granting consent creates the customer-tenant service principal automatically. Microsoft calls this local service-principal instance an Enterprise application. To verify it:- Open the Microsoft Entra admin center.
- Go to Entra ID → Enterprise apps → All applications.
- Search for CodeAnt Azure DevOps Integration.
- Open the application and confirm that it is in the tenant from Step 1.
Step 4: Add the service principal to Azure DevOps
Admin consent lets Microsoft Entra issue tokens, but it does not grant access to an Azure DevOps organization. The service principal must also be added as an Azure DevOps user.-
Open your Azure DevOps organization:
- Select Organization settings → Users.
- Select Add users.
- Search for CodeAnt Azure DevOps Integration. If the name is not found, paste the enterprise application’s Object ID from Step 3.
- Configure the user:
- Select Add.
Repository permissions
The project Readers group is the recommended least-privilege starting point. It can read repository contents and participate in pull requests, including creating comments. If your organization overrides the built-in group permissions, open Project settings → Repositories → Security, select CodeAnt Azure DevOps Integration, and confirm that these permissions are not denied:- Read
- Contribute to pull requests
Microsoft Entra and Azure DevOps identity changes can take a few minutes to propagate. If the service principal is not searchable immediately, wait briefly, refresh the page, and try its Object ID.
Step 5: Validate and save in CodeAnt
Return to the open CodeAnt dialog and select Validate access & Add. CodeAnt requests a short-lived Microsoft Entra token and checks that the service principal can access at least one project in the Azure DevOps organization. The organization is saved only after this validation succeeds.No PAT or customer-managed client secret is saved. CodeAnt stores the tenant association needed to request short-lived access tokens for this organization.
- The tenant ID belongs to the directory connected to the Azure DevOps organization.
- CodeAnt Azure DevOps Integration exists under Enterprise applications in that tenant.
- The same service principal is present in Organization settings → Users.
- Its access level is Basic.
- It has access to at least one selected project and repository.
- No inherited or explicit Deny overrides its repository permissions.
Step 6: Verify the integration end to end
- In CodeAnt, confirm that the Azure DevOps organization shows Configured.
- Start a scan for a repository in one of the selected projects.
- Create a new pull request in that repository.
- Confirm that CodeAnt posts its status and review comments.
- Confirm that new automated activity is attributed to CodeAnt Azure DevOps Integration, not to a person’s Azure DevOps account.
Change an existing organization from PAT to Microsoft Entra
- In CodeAnt, open Settings → Add AD org.
- Find the existing organization and select Update credentials.
- Select Microsoft Entra.
- Enter the tenant ID and select Grant admin consent.
- Complete Steps 3 and 4 above if the service principal is not already configured.
- Return to CodeAnt and select Validate access & Update.
Remove the integration
To revoke access completely:- Remove CodeAnt Azure DevOps Integration from Azure DevOps → Organization settings → Users in every connected organization.
- Remove or replace the organization credentials in CodeAnt.
- If no CodeAnt Azure DevOps organization in the tenant uses the integration, remove the enterprise application or revoke its consent in Microsoft Entra ID → Enterprise apps.
Troubleshooting
I cannot find the tenant UUID
I cannot find the tenant UUID
In the Azure portal, open Microsoft Entra ID → Properties and copy Tenant ID. Do not copy the subscription ID shown on a subscription page. See Microsoft’s tenant ID guide for portal, PowerShell, and CLI options.
The service principal does not appear in Azure DevOps
The service principal does not appear in Azure DevOps
First confirm that CodeAnt Azure DevOps Integration exists under Microsoft Entra ID → Enterprise apps. Then search for its Object ID in Azure DevOps → Organization settings → Users → Add users. Confirm that Azure DevOps is connected to the same tenant and allow time for identity propagation.
Admin consent succeeded, but validation fails
Admin consent succeeded, but validation fails
Consent and Azure DevOps authorization are separate. Add the service principal to the Azure DevOps organization with Basic access, select at least one project, and grant repository Read and Contribute to pull requests access. Then retry validation.
Microsoft returns a tenant mismatch error
Microsoft returns a tenant mismatch error
The Microsoft account used for consent selected a different directory. Switch directories in the Microsoft sign-in flow, or restart setup with the Directory (tenant) ID that backs the Azure DevOps organization.
Review comments still show a person's name
Review comments still show a person's name
Existing comments keep their original author. Create a new pull request after Validate access & Update succeeds. New CodeAnt activity should be attributed to CodeAnt Azure DevOps Integration. If it is not, confirm that you updated the intended Azure DevOps organization in CodeAnt.