Introduction
Audit logs are an important part of enterprise software development. They help administrators understand who performed an action, when it happened, and what changed. In Azure DevOps, audit events can be used for security investigations, compliance reviews, operational troubleshooting, and understanding changes made across an organization.
Azure DevOps is moving its audit-event authorization model toward Microsoft Entra ID. This change matters because applications and services that access Azure DevOps audit data may need to update how they authenticate and authorize those requests.
For developers and administrators, this is not simply a change to an API endpoint. The important part is understanding which applications consume audit data, which identity they use, what permissions they have, and whether those permissions still work after the authorization change.
This article explains what the change means, how Microsoft Entra authorization fits into Azure DevOps audit access, what existing integrations should be checked, and how teams can prepare their applications.
What Are Azure DevOps Audit Events?
Azure DevOps audit events record activities that happen within an organization.
Depending on the operation and service, audit information can help answer questions such as:
Who performed the action?
What action was performed?
When did it happen?
Which Azure DevOps resource was affected?
Which identity performed the operation?For example, an organization may need to investigate a change to repository permissions.
A security administrator might start with:
Repository permissions changed
|
v
Find audit event
|
v
Identify user or application
|
v
Check timestamp
|
v
Review related activityThis makes audit data particularly important in enterprise environments.
What Is Changing?
The important change is the authorization mechanism used for accessing Azure DevOps audit events.
Microsoft Entra ID provides identity and access management for Microsoft cloud services. Instead of relying on older authorization patterns for an application to access audit information, organizations can increasingly use Microsoft Entra identities and access controls.
The practical effect is that applications consuming Azure DevOps audit data need to be reviewed.
The application might be:
A security monitoring service
A compliance reporting application
An internal dashboard
A SIEM integration
A scheduled audit-export job
A custom Azure Function
A PowerShell automation
A service used by an enterprise security team
If any of these applications access Azure DevOps audit information, the identity and authorization configuration should be checked.
Why Microsoft Entra ID Matters
Microsoft Entra ID provides a centralized identity model for applications and users.
Instead of treating every application as an isolated API consumer, organizations can manage identities and access through a common identity platform.
A simplified architecture looks like this:
Application
|
v
Microsoft Entra ID
|
| Access Token
v
Azure DevOps
|
v
Audit DataThe application obtains an access token from Microsoft Entra ID.
Azure DevOps then validates the identity and determines whether the request is authorized.
This model fits naturally into enterprise environments where application identities, access policies, credentials, and monitoring are already managed through Microsoft Entra.
User Identity vs Application Identity
One of the most important concepts to understand is the difference between a user identity and an application identity.
A user-based application may operate on behalf of a developer:
Developer
|
v
Sign in
|
v
Microsoft Entra ID
|
v
Access Token
|
v
Azure DevOpsAn automated service usually does not have a human sitting in front of it.
For example:
Scheduled Job
|
v
Application Identity
|
v
Microsoft Entra ID
|
v
Azure DevOps Audit APIThis distinction matters because automated audit integrations should not depend on an individual developer's credentials.
If a reporting job runs every night, its identity should be designed specifically for that workload.
What Developers Should Check
The first step is to identify applications that access Azure DevOps audit information.
Search internal repositories and infrastructure configuration for audit-related API calls and Azure DevOps authentication code.
For example, a development team might find code similar to:
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", accessToken);
var response = await client.GetAsync(auditEndpoint);Finding the API call is only the first step.
You also need to determine where accessToken comes from.
It could be coming from:
Microsoft Entra ID
A service principal
Managed identity
An existing user authentication flow
A stored secret
Another identity provider
The authentication mechanism is the part that needs careful review.
Review Service Principals
Many enterprise applications use service principals to access cloud resources.
A service principal represents an application identity that can be granted permissions without requiring a human user to authenticate interactively.
A typical flow looks like this:
Application
|
| Client Credentials
v
Microsoft Entra ID
|
| Access Token
v
Azure DevOpsThe application can then use the token to call an authorized Azure DevOps resource.
When moving to Microsoft Entra authorization, teams should review which service principals are currently used and whether they have the required access.
Do not assume that an application having a valid Entra identity automatically means it has permission to access Azure DevOps audit information.
Identity and authorization are separate concerns.
Authentication Is Not Authorization
This distinction causes many migration problems.
Authentication answers:
Who are you?Authorization answers:
What are you allowed to do?For example, an application can successfully authenticate with Microsoft Entra ID and receive an access token.
That does not necessarily mean the application can read Azure DevOps audit data.
The complete flow is:
Application
|
v
Authenticate
|
v
Receive Token
|
v
Call Azure DevOps
|
v
Authorization Check
|
+---- Allowed ----> Audit Data
|
+---- Denied -----> 401 / 403When troubleshooting a migration, this distinction is extremely useful.
Why Existing Integrations Can Break
An existing audit integration may have been designed around an older authentication model.
For example:
Legacy Application
|
v
Old Credential
|
v
Azure DevOps Audit APIAfter an authorization change, the same application may need to move toward:
Updated Application
|
v
Microsoft Entra Identity
|
v
Access Token
|
v
Azure DevOps Audit APIThe business logic of the application may not need to change.
The authentication and authorization layer might be the primary area requiring modification.
This is good news for teams because it means the migration can often be isolated instead of requiring a complete rewrite of the audit-processing application.
Example: Azure Function Reading Audit Data
Consider an Azure Function that runs every morning and retrieves Azure DevOps audit information.
The architecture could look like:
Timer Trigger
|
v
Azure Function
|
v
Microsoft Entra Authentication
|
v
Azure DevOps
|
v
Audit Events
|
v
Storage / SIEM / ReportA simplified C# application structure could look like this:
public async Task ProcessAuditEventsAsync(
CancellationToken cancellationToken)
{
var accessToken = await tokenProvider
.GetAccessTokenAsync(cancellationToken);
using var request = new HttpRequestMessage(
HttpMethod.Get,
auditEndpoint);
request.Headers.Authorization =
new AuthenticationHeaderValue(
"Bearer",
accessToken);
using var response = await httpClient.SendAsync(
request,
cancellationToken);
response.EnsureSuccessStatusCode();
var content = await response.Content.ReadAsStringAsync(
cancellationToken);
await auditProcessor.ProcessAsync(
content,
cancellationToken);
}The important part of this example is the separation between token acquisition and audit processing.
The business logic does not need to know how the identity token was obtained.
That makes authentication changes easier to manage.
Keep Authentication Separate From Business Logic
A common mistake is putting authentication code directly inside the audit-processing code.
For example:
public async Task ProcessAuditAsync()
{
// Authentication
// Token generation
// API request
// JSON parsing
// Business rules
// Database updates
}This creates unnecessary coupling.
A better structure is:
AuditService
|
+-- TokenProvider
|
+-- AzureDevOpsClient
|
+-- AuditProcessor
|
+-- AuditRepositoryEach component has a focused responsibility.
For example:
public interface ITokenProvider
{
Task<string> GetAccessTokenAsync(
CancellationToken cancellationToken);
}The Azure DevOps client can depend on this abstraction without knowing whether the token comes from a managed identity, service principal, or another supported Entra authentication mechanism.
Managed Identity Can Reduce Credential Management
When an application runs on Azure resources that support managed identities, a managed identity can reduce the need to store application credentials.
The architecture becomes:
Azure Resource
|
v
Managed Identity
|
v
Microsoft Entra ID
|
v
Access Token
|
v
Azure DevOpsThe application does not need to store a client secret in source code or configuration.
This is particularly useful for scheduled services, Azure Functions, App Services, and other Azure-hosted workloads.
However, managed identity does not remove the need for authorization configuration. The identity still needs appropriate permissions.
Do Not Store Client Secrets in Source Code
During an authentication migration, developers sometimes create a quick workaround by placing credentials directly in configuration files.
For example:
{
"clientSecret": "secret-value"
}This should not be committed to a repository.
Secrets can leak through:
Git history
Build logs
Configuration backups
Error messages
Developer machines
CI/CD artifacts
Use an appropriate secret-management mechanism when a secret is required, and prefer managed identities where the architecture supports them.
Check CI/CD Pipelines
Audit integrations are often deployed through CI/CD pipelines.
This means the migration should not stop at application code.
Review:
Pipeline variables
Service connections
Environment variables
Secret stores
Deployment identities
Infrastructure-as-code
Scheduled jobs
A pipeline may successfully deploy an application while the application later fails when it tries to obtain an access token.
That is why authentication testing should happen after deployment as well as during local development.
Handling 401 and 403 Errors
Two HTTP errors are particularly useful during authorization troubleshooting.
401 Unauthorized
A 401 response generally indicates that the request was not successfully authenticated.
Possible causes include:
Missing access token
Expired token
Invalid token
Incorrect authentication flow
Incorrect audience or resource configuration
The first thing to inspect is token acquisition and the request's authorization header.
403 Forbidden
A 403 response is different.
It generally means that the identity was recognized but does not have sufficient permission for the requested operation.
For example:
Token valid
|
v
Identity recognized
|
v
Permission check
|
v
403 ForbiddenThis is why repeatedly changing authentication code will not necessarily fix a 403.
The application's authorization configuration needs to be reviewed.
Common Mistakes
Assuming a Valid Entra Token Is Enough
Receiving a Microsoft Entra token proves that the application successfully authenticated with Entra. It does not prove that Azure DevOps will authorize the requested audit operation.
Teams should separately validate token acquisition and Azure DevOps permissions.
Migrating Only Local Development
An application may work on a developer machine but fail in production because the production environment uses a different identity.
Always test the actual identity used by the deployed workload.
Using a Human Account for Automation
A scheduled audit process should not depend on a developer's personal account. People change roles, leave teams, or lose permissions.
Use an application identity designed for the workload.
Ignoring Existing Service Connections
Teams often focus on application code and forget that deployment pipelines and service connections may also depend on the previous authorization model.
Giving Excessive Permissions
Migration work can lead to overly broad permissions because developers want to make the first test succeed quickly.
Once the integration works, permissions should be reduced to the minimum required.
Best Practices
Inventory Audit Consumers Before Making Changes
Start by identifying every application that reads Azure DevOps audit information. Include internal tools, scheduled jobs, security systems, dashboards, and third-party integrations.
Without this inventory, a team can successfully migrate one application while another silently continues using the old configuration.
Use Application Identities for Automated Jobs
Automated workloads should have their own identities. This improves operational continuity and makes permission reviews easier because the identity represents a service rather than a person.
Centralize Authentication Code
Create one authentication component instead of implementing token acquisition separately in every Azure DevOps client.
This reduces duplication and makes future identity changes easier.
Use Least Privilege
Only grant the permissions required for the application's actual audit workload. Read-only audit reporting should not require unrelated administrative permissions.
Monitor Authentication Failures
After migration, monitor authentication and authorization failures.
A successful deployment does not prove that every scheduled or event-driven workflow is functioning correctly.
Test Before Removing Legacy Access
Do not immediately remove an older authentication configuration just because the new integration works in development.
Run the new flow in the target environment, verify audit data retrieval, confirm monitoring, and then remove unnecessary legacy credentials.
Advantages
Centralized Identity Management
Using Microsoft Entra ID gives organizations a common identity layer for applications and services. This can make identity lifecycle management easier because application access can be reviewed using the same broader identity-management processes used elsewhere in the Microsoft environment.
Better Separation Between Users and Applications
Application identities allow automated audit services to operate independently of individual employees. This improves reliability because the service does not stop working simply because a developer's account changes or is removed.
Easier Enterprise Governance
Microsoft Entra-based authorization fits into broader enterprise security practices. Organizations can apply identity governance, access reviews, monitoring, and security controls around application identities instead of maintaining isolated credential systems for every integration.
Reduced Credential Exposure
When managed identities are available, applications can avoid storing long-lived client secrets. This reduces one common source of credential leakage and removes the need to rotate some types of application credentials manually.
Disadvantages
Migration Requires Planning
Existing audit integrations may have been running for years and can depend on authentication behavior that is not obvious from the application code. Teams need to identify consumers, understand their identities, test the new authorization flow, and coordinate deployment changes.
Permissions Can Be Difficult to Diagnose
A token can be valid while the Azure DevOps request still fails. Developers therefore need to understand both authentication and authorization. This can make troubleshooting more involved than simply checking whether a credential exists.
Multiple Environments Increase Complexity
Development, testing, staging, and production may use different identities and permissions. An integration that works locally can fail in production if the deployed identity has not been configured correctly.
Existing Automation May Need Updates
Scripts, scheduled jobs, CI/CD processes, monitoring systems, and internal tools may all use different authentication mechanisms. A migration therefore needs to cover more than the main application.
Troubleshooting Checklist
If an audit integration stops working after an authorization change, check the problem in this order:
1. Confirm the Application Identity
Determine exactly which user, service principal, managed identity, or other identity is making the request.
2. Confirm Token Acquisition
Verify that the application can obtain an access token successfully.
Do not immediately assume that a token-generation failure is an Azure DevOps permission problem.
3. Inspect the API Response
A 401 and 403 generally point toward different parts of the authentication and authorization flow.
4. Verify Azure DevOps Permissions
Check whether the authenticated identity has the permissions required for the audit operation.
5. Check Deployment Configuration
Compare local, staging, and production identity configuration.
6. Review Logs
Look for token acquisition failures, authorization errors, endpoint errors, and unexpected identity information.
Avoid logging access tokens or secrets.
A Practical Migration Plan
A controlled migration can be approached in several steps.
Step 1: Find All Audit Integrations
Search source repositories, infrastructure configuration, scripts, and scheduled jobs for Azure DevOps audit API usage.
Step 2: Identify the Current Identity
For each integration, document which identity is currently used.
Step 3: Design the Microsoft Entra Flow
Choose an appropriate application identity and authentication method for the workload.
Step 4: Configure Permissions
Grant only the required access.
Step 5: Update the Authentication Layer
Change token acquisition without unnecessarily changing the audit-processing business logic.
Step 6: Test in a Non-Production Environment
Validate authentication, authorization, data retrieval, error handling, and monitoring.
Step 7: Deploy and Monitor
Deploy the change to production and watch the audit integration for failures.
Step 8: Remove Unnecessary Legacy Credentials
Once the new flow has been verified, remove credentials and permissions that are no longer needed.
Summary
The move toward Microsoft Entra authorization for Azure DevOps audit events is important for teams that consume audit information through applications, automation, security tools, and internal reporting systems.
The main development task is not rewriting the audit-processing logic. The bigger task is reviewing how each application authenticates and whether its identity has the required Azure DevOps permissions.
Developers should start by identifying every audit-data consumer, documenting its current identity, and separating authentication code from business logic. From there, the application can be moved toward a Microsoft Entra-based identity model and tested carefully in each environment.
The most important distinction to remember is simple:
Authentication tells Azure DevOps who the application is. Authorization determines what that application can access.
Treat both separately, use least privilege, avoid human credentials for automation, and test the actual production identity before removing the old configuration. That approach makes the authorization transition much easier to manage and reduces the chance of discovering a broken audit integration after deployment.

Join the conversation! Your thoughts help the community grow.