When it is written
Core Directory writes the record in the ApplicationManagement category when consent is given to an application, by a user for themselves or by an administrator. Microsoft's table of permission activities lists it as the record of a user granting consent, with a user as the actor. Microsoft lists granting delegated access and granting app-only access as separate activities (Add delegated permission grant, Add app role assignment to service principal), and its Sentinel templates tie those records to the consent through a shared CorrelationId. The application's service principal is in TargetResources. Microsoft's guidance reads two of its modified properties: ConsentContext.IsAdminConsent (True when an administrator consented, which can mean broad access to the organization's data) and ConsentAction.Permissions (the permissions granted). Microsoft's security operations guide rates end-user consent (IsAdminConsent false) low and asks to look at privileged consenting accounts, high-risk permissions and suspicious application names.
Who can consent: what a user may consent to for themselves is set by the tenant's user consent setting, which the authorization policy stores as the app consent policy assigned to users (managePermissionGrantsForSelf.{id}; an empty list turns user consent off). For tenant-wide admin consent Microsoft names Privileged Role Administrator for any permission of any API, and Cloud Application Administrator, Application Administrator and AI Administrator for any permission except the app roles of Microsoft Graph; a custom role can carry the right too. A grant created directly through Microsoft Graph passes no consent prompt (Microsoft warns that permissions granted programmatically are not reviewed or confirmed and take effect at once), and Microsoft does not say whether such a grant also writes Consent to application: watch the two grant activities for it. Requests and approvals in the admin consent workflow are recorded separately, by the Access Reviews service under its own activity names.
Risk-based step-up consent is on by default and changes behaviour only where user consent is allowed: a user consent request Microsoft finds risky (for example a newly registered multitenant application without publisher verification asking for more than basic permissions) is stopped and needs admin consent. Microsoft describes the record for the case where the admin consent workflow is off and the user is shown error AADSTS90094: the attempt is then recorded as Consent to application, with the status reason Risky application detected; it does not say what is recorded when the workflow is on and the user sends a request from the prompt instead. Its security operations guide calls the record a failure, gives the reason as Microsoft.online.Security.userConsentBlockedForRiskyAppsExceptions and rates it medium, and its Sentinel template for this case reads failed records and takes the reason from a modified property named MethodExecutionResult., matching the word Risky. The three sources do not agree on the text or on where it sits, so read both ResultReason and the modified properties on a blocked record of your own. The switch behind the feature is the directory setting BlockUserConsentForRiskyApps, which a Privileged Role Administrator can turn off.
How to turn it on
Microsoft Entra ID audit logs records Consent to application calls to Microsoft Entra ID audit logs without any setup. Vendor documentation
Microsoft Entra ID records the audit log of every tenant without any setup: the records cannot be changed or deleted, and they can be read in the admin center (Entra ID > Monitoring & health > Audit logs) or through Microsoft Graph (auditLogs/directoryAudits). Microsoft keeps them for 7 days with Microsoft Entra ID Free (where collection starts the first time someone opens Entra ID or calls the reporting APIs) and 30 days with P1 or P2. That is not a collection point: to keep the records longer and send them to a SIEM, create a diagnostic setting (Entra ID > Monitoring & health > Diagnostic settings) that includes the AuditLogs category.
- Destinations: a Log Analytics workspace (the
AuditLogstable that Microsoft Sentinel reads; Microsoft notes that sending the logs to Azure Monitor turns on Sentinel's Microsoft Entra ID connector), an event hub (for a third-party SIEM) or a storage account. Creating the setting needs at least the Security Administrator role; any Microsoft Entra ID licence is enough to export the audit log (sign-in logs need P1 or P2). Ingestion and storage are billed by the destination. - Microsoft batches the records in intervals of about 5 minutes. After a new setting, allow up to 24 hours before records reach a storage account or SIEM, and up to three days for a Log Analytics workspace.
- B2C audit events are not included in the integration. With Microsoft 365 E5 or the Purview audit add-ons, Microsoft Purview Audit (Premium) can also keep the Entra ID audit log beyond the default period.
- One change can write several records: the audit activity reference lists PIM assignments as a
requestedand acompletedactivity, and the records of one PIM activation can carry differentCorrelationIdvalues (PIM writesroleAssignmentRequestIdinAdditionalDetailsto tie them together). - The address in a record is the OAuth client's address, as the TCP peer of the service's endpoint saw it.
az rest --method get --url "https://management.azure.com/providers/microsoft.aadiam/diagnosticSettings?api-version=2017-04-01"az monitor log-analytics query --workspace <workspace-guid> --analytics-query "AuditLogs | summarize LastRecord = max(TimeGenerated), Records = count()" --timespan P1Daz rest --method get --url "https://graph.microsoft.com/v1.0/auditLogs/directoryAudits?\$filter=activityDisplayName eq 'Consent to application'&\$top=5"Fields
The operation’s own fields first, then the fields every Microsoft Entra ID audit logs record has. Field names are the JSON paths of the record as the vendor documents it.
| Field | What it holds |
|---|---|
TargetResources | The service principal of the application that received consent (type ServicePrincipal, with its displayName and id). Microsoft's guidance reads its modified properties ConsentContext.IsAdminConsent and ConsentAction.Permissions. The values are strings that carry their own double quotes ("True" in Microsoft's sample record), which Microsoft's queries trim. Microsoft's Sentinel templates parse the permissions text for ConsentType: (AllPrincipals when the grant is for all users) followed by , Scope: and the permissions, separated by spaces; the rest of that text is not documented, and the sample marks it with .... One template also reads a property named TargetId.ServicePrincipalNames and takes the first GUID in it, a Microsoft hunting query reads ConsentContext.OnBehalfOfAll and counts True as consent for all users, and the template for blocked consent reads MethodExecutionResult. on failed records; none of them is in the sample, because Microsoft shows no value of them. Microsoft's playbook query takes the two documented properties by position (the first and the fifth entry): its templates look them up by displayName, which does not depend on the order. |
AdditionalDetails | Microsoft's Sentinel templates read the key User-Agent here, the user agent of the client the consent came from. One of them looks it up by key and another checks both the first and the second entry for it, so do not rely on its position. |
Fields every Microsoft Entra ID audit logs record has (17)
| Field | What it holds |
|---|---|
TimeGenerated | When the record was written to the Log Analytics workspace, in UTC. |
ActivityDateTime | When the activity was performed, in UTC. |
OperationNameRead by 2 rules | The activity, as the audit activity reference names it (for example Add member to role); Microsoft Graph returns the same name as activityDisplayName. The operation this page is about. |
Category | The audit category of the activity (UserManagement, GroupManagement, ApplicationManagement, RoleManagement, Policy...), as the audit activity reference lists it next to the activity and as Microsoft Graph describes its category property. Microsoft's AuditLogs table reference says instead that Audit is the only supported value, while Microsoft's Sentinel templates filter this column on the audit category (Category =~ "RoleManagement", Category =~ "AzureRBACRoleManagementElevateAccess"). Check the column on a record of your own. |
LoggedByService | The service that wrote the record (Core Directory, PIM, Conditional Access, Device Registration Service, Account Provisioning...). Each page's sample gives the service name the audit activity reference lists for the activity; Microsoft publishes few raw records, so for most activities the exact string in the column is not shown by Microsoft: check it on a record of your own before matching on it. |
AADOperationType | The kind of change (Add, Update, Delete, Assign, Unassign or Other). |
ResultRead by 1 rule | Result of the activity (success, failure, timeout). |
ResultReasonRead by 1 rule | Why the activity failed or timed out; some services also write a short text for successful activities. |
InitiatedBy. | When a user performed the activity, the user's UPN. |
InitiatedBy. | When a user performed the activity, the user's object ID. |
InitiatedBy. | The address of the client the user acted from, as the TCP peer of the service's endpoint (the OAuth client's address). |
InitiatedBy. | When an application or a Microsoft service performed the activity, its name (for example MS-PIM for Privileged Identity Management). |
InitiatedBy. | When an application performed the activity, the object ID of its service principal. |
Identity | The name of the identity in the token the request was made with: a user, a system account or a service principal. |
CorrelationId | An ID that ties together the records of activities that span services. Privileged Identity Management can write several values for one activation; it puts roleAssignmentRequestId in AdditionalDetails for that. |
Id | Unique identifier of the record. |
AADTenantId | The Microsoft Entra tenant the activity happened in. |
Values to know
ResultReason
| Value | Meaning | Signal |
|---|---|---|
Risky application detected | Risk-based step-up consent stopped a user consentThe status reason Microsoft's page on risk-based step-up consent gives. Read the application and the user, and check whether an administrator approved it later. | Attack signal |
Microsoft.online.Security.userConsentBlockedForRiskyAppsExceptions | The same block, as the security operations guide writes the failure reasonMicrosoft rates it medium. One of the two values the detection rule for blocked consent matches. | Attack signal |
TargetResources
| Value | Meaning | Signal |
|---|---|---|
ConsentContext.IsAdminConsent True | An administrator consented, possibly for the whole organizationMicrosoft says it can mean broad access to data, and to take immediate steps to confirm an attack when the value is unexpected. | Attack signal |
ConsentContext.IsAdminConsent False | A user consented for themselvesMicrosoft rates end-user consent low; read the permissions. | Expected |
ConsentAction.Permissions with ConsentType AllPrincipals | The grant is for all users of the tenantMicrosoft's Sentinel templates use it to tell consent for all users from consent for one user. | Attack signal |
MethodExecutionResult. containing Risky | A consent stopped by risk-based step-up consent, as Microsoft's Sentinel template reads itOn records whose Result is failure. The detection rule for blocked consent reads ResultReason only. | Attack signal |
Volume and noise
Depends on the consent settings: where users may consent to low-risk permissions, end-user consent is frequent and mostly benign. Admin consent, consent to mail, file or directory permissions, consent from a privileged account, and consent stopped as risky are the records to read first.
Keeping it manageable
- Split on
ConsentContext.IsAdminConsentinTargetResources>modifiedProperties; one detection rule reports every successful consent, another the consents stopped by risk-based step-up consent (ResultReason). - Read
ConsentAction.Permissionsand the application's publisher; extend your list of sensitive permissions. Find a modified property by itsdisplayName, not by its position, and trim the double quotes around the value. - Join the consent with the grant records of the same
CorrelationId(Add delegated permission grant,Add app role assignment to service principal), as Microsoft's Sentinel templates do. - Look for a later successful consent to an application that was first blocked as risky, and for a new account consenting soon after it was created: the detection logic on this page covers both.
Sample event
A Microsoft Entra ID audit logs record in the vendor’s format, with made-up values.
{
"TimeGenerated": "2026-11-18T09:31:02.118Z",
"ActivityDateTime": "2026-11-18T09:30:12.441Z",
"Id": "Directory_00000000-1111-2222-3333-444444444444_ABCDE_12345678",
"CorrelationId": "00000000-1111-2222-3333-444444444444",
"OperationName": "Consent to application",
"Category": "ApplicationManagement",
"LoggedByService": "Core Directory",
"Result": "success",
"ResultReason": "",
"Identity": "Jane Doe",
"InitiatedBy": {
"user": {
"id": "00000000-0000-0000-0000-00000000c0de",
"displayName": "Jane Doe",
"userPrincipalName": "j.doe@corp.example.com",
"ipAddress": "203.0.113.24"
}
},
"TargetResources": [
{
"id": "00000000-0000-0000-0000-0000000a9a9c",
"displayName": "Contoso Mail Helper",
"type": "ServicePrincipal",
"modifiedProperties": [
{
"displayName": "ConsentContext.IsAdminConsent",
"oldValue": null,
"newValue": "\"False\""
},
{
"displayName": "ConsentAction.Permissions",
"oldValue": null,
"newValue": "\"[... ConsentType: Principal, Scope: openid profile offline_access Mail.Read, ...]\""
}
]
}
],
"AdditionalDetails": [
{
"key": "User-Agent",
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"
}
],
"AADTenantId": "00000000-0000-0000-0000-00000000aaaa"
}Attacks this event reveals
Detection rules that read this event:
Detection logic (hypotheses that join this event with others) for:
References
- Microsoft Entra audit log categories and activities (Microsoft)
- Microsoft Entra security operations guide for applications (Microsoft)
- View activity logs of application permissions (Microsoft)
- Configure risk-based step-up consent (Microsoft)
- Compromised and malicious applications investigation (Microsoft)
- App consent grant investigation (Microsoft)
- Detect and remediate illicit consent grants (Microsoft)
- Configure how users consent to applications (Microsoft)
- defaultUserRolePermissions resource type (Microsoft Graph)
- Grant tenant-wide admin consent to an application (Microsoft)
- Overview of admin consent workflow (Microsoft)
- Suspicious application consent for offline access, analytic rule template (Microsoft Sentinel)
- Credential added after admin consented to Application, analytic rule template (Microsoft Sentinel)
- End-user consent stopped due to risk-based consent, analytic rule template (Microsoft Sentinel)
- Suspicious OAuth App Consent Granting Sensitive Permissions, hunting query (Microsoft Sentinel)