Skip to content
WETNav

Microsoft

Microsoft Graph activity logs

Every HTTP request made to Microsoft Graph in the tenant: URI, method, app, user or service principal, IP and the token it used.

Why it matters

Stolen tokens and malicious OAuth apps mostly act through Microsoft Graph. These logs show what they actually requested, such as mail, files, users or role assignments, and tie each request back to the sign-in that issued the token.

How long it lasts

  • Off by default. Enable the MicrosoftGraphActivityLogs category in Entra ID diagnostic settings and send it to Log Analytics, storage or an event hub.
  • Requires an Entra ID P1 or P2 license. Volume is high; budget for ingestion before turning it on.
  • Only requests made after the setting was enabled are available. There is no backfill.
Plan collection order across every source

Get the data

MicrosoftGraphActivityLogs
| where TimeGenerated > ago(7d)
| where AppId == "<app-id>" or UserId == "<user-object-id>"
| project TimeGenerated, RequestMethod, RequestUri, ResponseStatusCode, IPAddress, UserAgent, AppId, UserId, ServicePrincipalId, SignInActivityId
| order by TimeGenerated asc

Fields that matter

requestUriSentinel: RequestUri

The Graph endpoint called, for example /v1.0/users/{id}/messages.

requestMethodSentinel: RequestMethod

GET reads; POST, PATCH and DELETE change things.

responseStatusCodeSentinel: ResponseStatusCode

403 shows attempts the token was not allowed to make.

appIdSentinel: AppId

The client application. Match against consented apps and first-party IDs.

userId / servicePrincipalIdSentinel: UserId / ServicePrincipalId

Who the token represents: a user (delegated) or an app (application permissions).

ipAddressSentinel: IPAddress

Source of the request. Compare with the IP of the sign-in that issued the token.

signInActivityIdSentinel: SignInActivityId

Matches UniqueTokenIdentifier in the sign-in logs: the link from an API call to the sign-in.

scopes / rolesSentinel: Scopes / Roles

Delegated scopes or application roles in the token used.

userAgentSentinel: UserAgent

Scripting libraries and enumeration tooling often show up here.

Values to know

Traps

  • If the logs were not enabled before the incident, they cannot help with it. Turn them on now for the rest of the response.
  • Requests by first-party Microsoft apps are included, so volume is dominated by normal clients. Filter by AppId and user first.
  • A request with the same SignInActivityId from a different IP than the sign-in is a strong sign of token replay.

Playbooks that use it