Skip to main content

Microsoft 365 Activity Log

The Microsoft 365 Activity Log template collects the Office 365 unified audit log (mail, file, site, Teams, administrative and DLP activity from every Microsoft 365 workload) by subscribing to the Office 365 Management Activity API and polling it. It is the single highest-value feed most Microsoft 365 tenants have, because it records what an attacker does after they are already inside.

You never open the Microsoft portal: you enter an administrator's email address, and Microsoft asks that administrator to approve Fluency Office365 Event Reader, an application Fluency already operates, so there is no app registration and no client secret. The person who finishes the setup may not be you, and until they approve, the application reports Running and collects nothing.

The setup has two halves, and the Fluency half comes first:

  1. In Fluency: install the Microsoft 365 Activity Log template with Enable Admin Consent Mode? ticked and an email address that reaches the approver. The install sends the approval request.
  2. In Microsoft: a Cloud Application Administrator, Application Administrator or Global Administrator opens the link, signs in, checks that the request is for Fluency Office365 Event Reader from Fluency with four permissions, and clicks Accept.
Which Microsoft 365 template
TemplateCollectsAuthenticationLands in
Microsoft 365 Activity Log (this page)The unified audit logAdministrator consent to Fluency Office365 Event ReaderIndex Office365
Microsoft Entra ID Logs (Graph API)Entra directory auditAdministrator consent to FluencyAzureADAuditIndex MSEntra
Microsoft 365 InventoryTenant resource inventoryAdministrator consent to FluencyOffice365ResourceWatchResources
Microsoft 365 Bundle (Activity, Entra ID, Inventory)All threeClient secret only: the tenant ID, client ID and secret of an app registration you createBoth indexes and Resources

The three consent templates are separate Entra applications, each with its own permission set, so consenting to one does not consent to the others: installing all three means three requests, three approvals and three entries under Enterprise applications. The Microsoft 365 Bundle collects all three with one application and one credential, at the cost of an app registration and a client secret that expires; neither route collects more data than the other.

What arrives​

StreamWhat it holdsLands in
Unified audit logExchange, SharePoint and OneDrive, Entra, Teams, Power Platform, Purview and Viva Engage activityThe Office365 index
DLP eventsDLP matches across all workloads, including the detected sensitive dataThe Office365 index
Service messagesService-health and incident messagesThe Office365 index

The API serves only the last seven days, so collection that stops for longer than a week loses those events to Fluency for good (retention). Microsoft repeats events on purpose and guarantees no maximum latency, so expect duplicates and judge freshness in hours (duplicates and latency). The Entra activity here is the unified log's own record, not the directory audit that Microsoft Entra ID Logs (Graph API) reads from Graph, so running both overlaps in coverage, not in data.

Content types, the permission behind each, and how Microsoft duplicates, delays and expires the feed are in Reference.

Before you begin​

Unified audit logging must be on in the tenant. Nothing reaches the Management Activity API until it is (Microsoft's wording). It is on by default for most Microsoft 365 organizations, but not for Business Basic, Business Standard or Business Premium, and not for unmanaged tenants on an enterprise free trial. Check from Exchange Online PowerShell:

Get-AdminAuditLogConfig | Format-List UnifiedAuditLogIngestionEnabled

True means you are covered. If it returns False, turn it on in the Microsoft Purview portal (the Audit solution card shows a Start recording user and admin activity banner) or run:

Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $true

Changing that setting needs the Audit Logs role in Exchange Online; by default the Compliance Management and Organization Management role groups hold it. The change can take up to 60 minutes and is not retroactive, so turn it on, then let it run for a day before concluding the integration is broken.

An administrator who can consent on the tenant's behalf. A Cloud Application Administrator or Application Administrator should be able to approve this application, and a Global Administrator certainly can; if you are not sure, send it to a Global Administrator. Microsoft's rule, and why the other two consent templates need more, are in Which roles can approve.

An email address that will get the consent link to the approver. It does not have to be the administrator's own; see Install the Application.

Access to the Fluency portal with permission to install applications.

Part 1: Fluency​

Install the Application​

In the navigation rail, open Applications and click Install Application, then choose Microsoft 365 Activity Log from the Office Software (SaaS) and IAM category of the Application Catalog.

ParameterNotes
Enable Admin Consent Mode?Checkbox, ticked by default. Leave it ticked for the consent route. Unticking it changes the form; see If your tenant will not allow the consent route.
Admin Email addressWhere the consent link is sent: any valid email address. It plays no part in authentication: whoever opens the link signs in to Microsoft with the actual administrator account, so you can enter your own address and pass the link on.
datalakePre-filled managed.
datalake index namePre-filled Office365, the same default as the Microsoft 365 Bundle. Two applications writing to the same index name in the same lake will collide, and the second one aborts. Change the name on whichever you install second, or uninstall the other first.

datalake and datalake index name sit in the collapsed Advanced configuration section below Configuration; click its heading to reach them.

Leave Instance name and Display name at default / Default unless you are installing a second instance (collecting from two Microsoft 365 tenants, for example), in which case give each one a name you will recognise on the applications list.

Install Microsoft 365 Activity Log form with the Application section's Instance name and Display name fields, the Configuration section's Enable Admin Consent Mode? and Admin Email address fields, and Advanced configuration expanded to datalake and datalake index name, above Cancel, Dry run and Install Application

While Enable Admin Consent Mode? is ticked, Dry run is greyed out; there is no credential of yours for it to check. Click Install Application. The Applications page opens with the notice Default is launching. and lists the new application with its status badge.

Running means waiting

The badge reflects the pipeline, not the consent. Until the administrator approves in Microsoft, this application has nothing to read and looks identical to one that is collecting normally; there is no "waiting for approval" state to watch for. The check that answers the question is on the Microsoft side, in Confirm it is running.

Some organisations disable user and admin consent to third-party applications outright. If yours does, or if you would simply rather hold your own credential, untick Enable Admin Consent Mode; the form replaces the email field with three others:

ParameterNotes
Azure Tenant IDEntra's Directory (tenant) ID.
Azure ClientIDEntra's Application (client) ID for an app registration you create.
Azure ClientSecretThat registration's client secret Value.

This is the same credential shape Microsoft 365 Bundle uses, and the app registration is built the same way: follow Part 1 of that page, but add only the three Office 365 Management API permissions (ActivityFeed.Read, ActivityFeed.ReadDlp, ServiceHealth.Read) if this template is all you are installing.

If you are registering an application and managing a client secret anyway, consider the Microsoft 365 Bundle instead: it gives you the directory audit and sign-in logs from the same registration and the same secret, for a few more permission checkboxes. Unticking this box is the right answer when you specifically want only the unified audit log.

Part 2: Microsoft​

This half is performed by the administrator who opens the consent link: possibly you, possibly someone in a different team who has no idea why they are being asked. Everything below is written for them.

What the administrator receives​

Fluency sends a message to the address entered on the install form, containing a link to Microsoft's admin consent page for the application. Opening it takes them to login.microsoftonline.com, where they sign in with their administrator account, which need not be the address the message was sent to, and are shown the permission request.

If nothing arrives, check spam quarantine first, and treat a missing message as a support question rather than a reason to reinstall: reinstalling changes nothing about how the request is delivered.

Review the request and accept​

The consent screen is the only security control in this entire procedure. It is worth reading rather than clicking through.

Microsoft consent prompt headed Permissions requested, Accept for your organization, for the application Fluency Office365 Event Reader from fluencysecurity.com, listing four permissions

Four permissions are requested:

Consent screen wordingPermissionWhat it buys
Read activity data for your organizationActivityFeed.ReadThe unified audit log. This is the one the integration exists for.
Read DLP policy events including detected sensitive dataActivityFeed.ReadDlpDLP events, including the sensitive content that triggered them.
Read service health information for your organizationServiceHealth.ReadService-health and incident messages.
Sign in and read user profileUser.Read (delegated)Identifies the signing-in administrator during the consent itself. It is not used for collection.

Three checks before accepting:

  1. The application is Fluency Office365 Event Reader and the publisher is Fluency: fluencysecurity.com, or Fluency Corp. with a verified-publisher badge. If the name or the domain is anything else, stop. A line reading "This application is not published by Microsoft" is normal: it means only that Fluency is a third party, which is true of every SIEM integration.
  2. The list matches the table above. A consent screen asking for more than this is not this integration.
  3. The screen says Accept for your organization or Review for your organization. That is the tenant-wide grant. A screen without it is granting something narrower and the integration will not work.
The broadest permission

ActivityFeed.ReadDlp returns DLP events including the detected sensitive data: excerpts of the content that matched a DLP rule, such as card numbers or identifiers. If your organisation would rather Fluency never held that content, decide it here: the screen is all-or-nothing, so the answer is the client-secret route with only ActivityFeed.Read and ServiceHealth.Read granted.

Click Accept. Microsoft records the grant against the tenant and redirects back.

If the administrator clicks Cancel, Microsoft returns AADSTS65004: The resource owner or authorization server denied the request. and no grant is created. Nothing on the Fluency side reports this.

What the grant is, and what it is not​

Once accepted, the grant lives on the tenant, not on the administrator who approved it (how the consent route authenticates):

  • It does not expire. There is no secret to rotate and no renewal date to miss.
  • It survives the approver leaving. Deactivating the administrator who clicked Accept does not affect collection. This is the main practical advantage of the consent route over a client secret, and it is the opposite of how a personal API token behaves.
  • It is revocable by anyone with the role, from Enterprise applications, without telling Fluency. See Maintenance.
  • It does not grant a person anything. No Fluency user gains access to your tenant; the grant is to the application, which reads the audit feed and nothing else.

Confirm it is running​

Running only reports the pipeline, so confirm on the Microsoft side first. In the Microsoft Entra admin center, go to Entra ID → Enterprise apps → All applications and search for Fluency Office365 Event Reader. If consent was granted, the application is there. If it is not, the request was never accepted, and nothing else you check will tell you that.

Enterprise application entry for Fluency Office365 Event Reader showing the Properties page with Name and a Delete button in the command bar

To see exactly what was granted, open Security → Permissions. The Admin consent tab lists every permission with a Type column separating Delegated from Application, which matters, because several Microsoft permissions display the same wording for both.

Entra ID Permissions page for an enterprise application, showing the Grant admin consent button, the Admin consent and User consent tabs, and a permissions table with API Name, Claim value, Permission and Type columns

Then, on the Fluency side, check that events are landing in the Office365 index; see Confirm data is arriving. The API only delivers to an active subscription, and on a new one it can take up to 12 hours for the first content blobs to become available, so an empty index on the afternoon of the install is expected. Check that events are present, not that the count matches Purview: the feed repeats events on purpose and Purview deduplicates where the API does not, so a higher count in Fluency is the expected outcome (duplicates and latency).

Once Fluency Office365 Event Reader is listed under Enterprise apps and events are in the Office365 index, setup is complete.

Maintenance​

There is no credential to rotate: no secret expires, so nothing here needs a calendar entry. What can still break the integration is someone revoking the consent, so the maintenance task is review, not rotation. The address on the install form only delivered the approval request; once consent is granted it has no further role, so there is nothing to update when the named administrator changes jobs.

Reviewing and revoking the grant​

Anyone with the right role can revoke this at any time, from Entra ID → Enterprise apps → All applications → <the application> → Permissions → Admin consent, using the ... control on a permission row and selecting Revoke permission.

The Admin consent tab of an enterprise application&#39;s Permissions page, with the Revoke Permission control open on a permission row

  • Nothing tells Fluency. Collection stops and the application keeps reporting Running. If a feed goes quiet with no other explanation, check whether the grant is still there before checking anything else.
  • Revoking does not stop the application being re-consented. Microsoft notes that "Revoking the current granted permission doesn't stop users from re-consenting to the application's requested permissions." If the intent is to block it permanently, delete the enterprise application, or restrict consent at the tenant level.

Removing the integration​

Uninstall the application in Fluency first, with the Uninstall button at the top right of its details page (v1: the red Uninstall button at the foot of its details panel on Platform → Applications), so the pipeline stops cleanly. Then, in Microsoft, delete the enterprise application (Properties → Delete) or revoke its permissions as above.

Troubleshooting​

SymptomLikely causeFix
The application shows Error (v1: Aborted) immediately after installThe index name is already taken in that lake, usually Office365 from the Microsoft 365 BundleThe error message in the application's details names the index. Uninstall the conflicting application, or reinstall this one with a different index name.
Running, but the index is empty and has always been emptyThe consent was never grantedSearch Enterprise applications for Fluency Office365 Event Reader; if it is absent, resend the request.
The administrator never received anythingWrong address, or the message was quarantinedCheck the address on the install form, then spam quarantine. Reinstalling does not change how the request is delivered.
The administrator sees Need admin approval rather than a consent screenAADSTS90094: the signed-in account is not authorised to consentHave someone holding Cloud Application Administrator, Application Administrator or Global Administrator open the same link (which roles).
Consent fails with AADSTS65004The administrator selected CancelSend the request again. No grant was created.
Running and consent is granted, but the index is still empty after a few hoursUnified audit logging is off, or the subscription is inside its first-content windowRun Get-AdminAuditLogConfig | FL UnifiedAuditLogIngestionEnabled (Before you begin); if True, wait out the 12 hours.
Collection worked for months, then stopped, with no change on the Fluency sideThe grant was revoked, or the enterprise application was deletedCheck Enterprise applications → Permissions → Admin consent; re-consent if it is gone (Reviewing and revoking the grant).
Events arrive hours late, or out of orderNormal: no latency SLA and no ordering guaranteeJudge freshness over hours, not minutes, and sort on CreationTime (duplicates and latency).
The same event appears more than onceNormal: Microsoft duplicates deliberately and leaves deduplication to the SIEMDeduplicate on the record's Id (duplicates and latency).
Fluency's event count is higher than the same search in PurviewNormal: Purview deduplicates its own search results; the API does notNothing to fix; the counts are not meant to match.
Events are missing for a period longer than a weekContent blobs expiredUnrecoverable through the API; the records are still in Purview and can be exported from there (retention).
The stream fails with AF20022No subscription exists for that content type/subscriptions/start is throttled to one call per content type per 15 minutes: wait, then uninstall and reinstall so the subscriptions are started again.
Microsoft.Office.Compliance.Audit.DataServiceException: Tenant <tenantID> does not existUnified audit logging has never been enabledEnable it (Before you begin), then allow 60 minutes plus several hours before the first events are retrievable.

Reference​

What the feed holds once it lands and how Microsoft delivers it, for searches and detection rules written against the Office365 index, and the reasoning behind the consent the steps above link to.

Unified audit logging

Microsoft is explicit: "Before you can access data through the Office 365 Management Activity API, you must enable unified audit logging for your Office 365 organization."

Microsoft also notes that "The unified audit log configuration change can take up to 60 minutes to take effect." Nothing that happened before you switched it on is ever recoverable: the audit log only holds what it was recording at the time.

Content types and permissions

Events land in the data-lake index named on the install form, Office365 by default. The Management Activity API is subscription-based rather than a plain query: Fluency starts a subscription per content type, then polls for content blobs and fetches each one.

Content typeCoversBacked by
Audit.AzureActiveDirectorySign-in and directory activity as it appears in the unified logActivityFeed.Read
Audit.ExchangeExchange Online administrative and mailbox activityActivityFeed.Read
Audit.SharePointSharePoint and OneDrive file and site activityActivityFeed.Read
Audit.GeneralEverything else: Teams, Power Platform, Purview, Viva EngageActivityFeed.Read
DLP.AllDLP events across all workloads, including the detected sensitive dataActivityFeed.ReadDlp
Service messagesService-health and incident messagesServiceHealth.Read

Audit.AzureActiveDirectory is why this template and Microsoft Entra ID Logs (Graph API) look like they overlap and do not. Both carry directory activity, but from different sources with different shapes: this one is Entra activity as Microsoft 365 records it in the unified log, and the other is the Entra directory audit read directly from Microsoft Graph. They are different records of overlapping events, retained under different rules, so running both is duplication in coverage, not in data.

Which content types your install subscribes to. The content types above are what the API offers and what the consented permissions cover. The subscriptions the Microsoft 365 Activity Log template actually starts are recorded on the install itself: open the application's details and read its Actions list, which lists every object the install created.

Duplicates and latency

Microsoft states plainly that this feed repeats events on purpose, and that deduplicating them is the consumer's job:

This duplication of events is an expected and designed behavior intended to prevent the loss of any audit events. When an error is encountered by an audit event, the audit service retries the process, which may result in duplicate audit events being generated and stored in the audit log storage(s). While exporting audit search results using the UI from the Microsoft Purview portal automatically removes duplicates, the Office 365 Management Activity API does not have this de-duplication feature. Consequently, duplicates may appear in the results returned by the Office 365 Management Activity API. It is the responsibility of the SIEM solution to implement logic to remove such duplicated events upon ingestion.

Three consequences follow, and all three produce support tickets from people who think something is broken:

  • Counts will not reconcile against Purview. The portal's audit search deduplicates; this API does not. A higher count in Fluency than in Purview for the same window is the expected result, not evidence of double ingestion.
  • Deduplicate on the record's Id, the GUID that uniquely identifies an audit record, and sort on CreationTime rather than on arrival order: a later content blob can contain earlier events.
  • You cannot cross-check with Microsoft's help. "Microsoft doesn't provide any kind of a log that allows you to cross-check any given application or third-party (ISV) application." If you need assurance that nothing was missed, the check has to be built from the content blobs themselves.

Latency is loose for the same reason: Microsoft trades speed for completeness and declines to commit to a number. There is "no guaranteed maximum latency for notification delivery (in other words, there is no SLA)"; typically "most notifications are sent within one hour of the event", and for "core services (such as Exchange, SharePoint, OneDrive, and Teams) event availability is typically 60 to 90 minutes." Microsoft's stated reason is worth quoting to anyone who asks why this feed is not real-time: "Because audit events are often used for forensic investigations, Microsoft prioritizes data completeness over latency."

Judge this integration's health over hours, not minutes, and never alert on the absence of an event within a short window.

Retention, and how long an outage can last

Two separate clocks apply, and confusing them is the usual way people misjudge how urgent an outage is.

  • Microsoft's retention of the audit log itself. Managed by Microsoft Purview. Microsoft notes that "The default retention period for Audit (Standard) changed from 90 days to 180 days. Audit (Standard) logs generated before October 17, 2023 are retained for 90 days. Audit (Standard) logs generated on or after October 17, 2023 follow the new default retention of 180 days." Audit (Premium) retains Exchange, SharePoint, OneDrive and Entra records for one year.
  • How far back the API will actually serve. Much shorter. Content blobs expire after 7 days, startTime may not be more than 7 days in the past, and a single listing call may not span more than 24 hours.

Microsoft draws the distinction itself:

The data that is returned by both methods is the same. The only difference is that with the API, you can get data for the last 7 days only [...] When searching the audit log in the Security & Compliance Center (or by using the corresponding Search-UnifiedAuditLog cmdlet in Exchange Online PowerShell), you can get data for the retention period in effect when the data is generated (for example, 90 days or one year).

So the audit log in Purview is not the thing Fluency reads. If collection stops for longer than a week, the events are still searchable in Purview and are permanently unavailable to the integration. Treat a week as the hard deadline for fixing a broken collection, not a month, and note that the recovery path is a Purview export, not a backfill.

Collection: the Management Activity API

Base URL for a commercial tenant:

https://manage.office.com/api/v1.0/{tenantId}/activity/feed/{operation}

Government tenants use manage-gcc.office.com (GCC), manage.office365.us (GCC High) or manage.protection.apps.mil (DoD).

Collection is a two-step poll: GET /subscriptions/content?contentType=...&startTime=...&endTime=... lists available content blobs, and each blob is fetched from its own contentUri. The constraints that shape it:

  • A new subscription can take up to 12 hours to produce its first content blob.
  • startTime and endTime must be no more than 24 hours apart, and startTime no more than 7 days in the past.
  • Content blobs expire after 7 days; AF20051 is returned for anything older.
  • Listing pages through a NextPageUri response header, not a body property.
  • Events are aggregated across datacenters and are not guaranteed to be in order; a later blob can contain earlier events.
  • Duplicates are by design (duplicates and latency). Deduplicate on Id, sort on CreationTime.
  • contentCreated is the date the notification was created, not the date of the event. Microsoft is explicit that "you can never query the API directly for events that occurred within any given period."
  • Throttling is per tenant, with a baseline of 2,000 requests per minute, and E5 organizations "will get approximately twice as much bandwidth as non-E5 organizations."
  • Blob retrieval is throttled separately, returning 403 AF429 ("Too many requests. Method=GetBlob") when the PublisherIdentifier parameter is omitted, because callers without it share one general pool.
  • Repeated /subscriptions/start calls are throttled to one per 15 minutes per content type.

Auth is OAuth2 client credentials against https://manage.office.com/.default. The tenant ID in the URL must match the tid in the token, or the call fails with AF20010.

What the install creates. The Actions list in the application's details records one line per object created. addDatalakeIndex entries create the index in the managed lake as a side effect of the install, which is why a name that already exists aborts the whole application rather than just one stream.

Microsoft documentation

Fluency

Other integrations