Repository navigation
Licence Activity Diagnostics
Licence Activity → Licence Activity Diagnostics
On a very large tenant, start with a short range. Each SQL command behind Licence activity has a 20-second limit, and loading a reporting window has a 30-second deadline, so a wide range can be refused with HTTP 503. A 503 means unavailable: try again shortly or narrow the range. It never means zero activity. Choose the shortest range that answers your question, and don't keep retrying a wide one. In the historical synthetic test below, a larger Azure SQL tier didn't make 180-day ranges load, and even 7-day ranges sometimes timed out. Those results came from a closed, unmerged review on an older build, so they are not a measured limit for your build: measure your own deployment before relying on wide ranges.
The real Azure review used the same synthetic 300,000-user, 50-SKU database at S4 / 200 DTUs and S6 / 400 DTUs, with 7.8 million rows in each workload activity table. Neither tier passed full acceptance. Each SQL command retained its 20-second timeout, and each shared response retained its 30-second publication deadline.
| Observed result | S4 / 200 DTUs | S6 / 400 DTUs |
|---|---|---|
| Instrumented 7-day HTTP overview median | 11.937 seconds | 7.341 seconds |
| Exact 180-day HTTP overview | 503 / timeout | 503 / timeout |
| Completed cold/warm user pairs | 750 of 1,500 required | 750 of 1,500 required |
| Managed/private process growth | 135.4 / 146.6 MiB | 152.4 / 160.5 MiB |
The full narrow-window user matrix, search, paging, demographic views, concurrency and Excel cases completed. The first wide overview stopped the remaining matrix, and memory growth exceeded the predeclared 128-MiB bound. The first uninstrumented 7-day adapter repeat also timed out at both tiers, so the instrumented narrow medians are not a guarantee that choosing seven days avoids the problem.
This was the real API/cache/SQL/export logic with an in-process HTTP client and server, including the SQL network path. It was not an IIS/App Service/Entra deployment test; SQL buffer/plan caches were retained and uncontrolled. Actual plans identified aggregation spills and expensive access paths. No permanent index, schema change, narrower date range or larger production timeout was introduced.
Treat a retryable error as unavailable, not zero activity. Do not repeatedly retry wide windows and assume a larger timeout/SKU fixes them. These are historical synthetic review results from PR #458, closed without merge—not fresh acceptance of 1854 or proof of improved target-tier performance. #425 remains open; source diagnostics are not a measured deployment result.
PR #457 proposed query and snapshot-consistency follow-up and is also closed without a merge. Do not treat either closed draft as the current release PR, or its proposed changes as proof that the acceptance matrix above now passes. Use the installed build's measurements and current release notes for that conclusion.
Privacy-safe LicenceActivityLifecycle events identify a run, stage and duration without logging query text, user payloads, search terms or filter values. Use these alongside SQL execution diagnostics to distinguish query execution, materialisation, projection, publication and web-host shutdown. Do not enable broad SQL/parameter logging against tenant data for this report.
Current stable: #739's CoverageWeek and WorkloadEvidence diagnostic stages below are available; 1850 did not emit them. The existing optional save diagnostics remain separate.
Unknown is not zero usage. For the Microsoft 365 usage-report sources, a single incomplete week makes the activity band Unknown for every licence holder across the selected period, even when earlier weeks contain positive activity. This is a period-wide coverage decision, not evidence that an E5 holder never used Outlook or another service. It applies to every licence, not just E5.
Builds with the coverage diagnostics emit two additional stages of LicenceActivityLifecycle into the deployment's own Application Insights:
| Stage | Evidence |
|---|---|
CoverageWeek |
One event per service/week portion, with UTC FromUtc, ToUtc, MissingDates, expected/present day counts, and Selected. Reason is Complete, MissingReportDays or Unsettled. |
WorkloadEvidence |
One event per service after evidence loading: source, coverage status, expected/observed weeks, GroupFiltered, and distinct users with rows, activity and complete frequency evidence. These are the shared, unfiltered population's counts, not the selected SKU's counts. |
Open Licence activity and wait for a newly prepared snapshot. A cold read model emits these events; a cache hit or changing only the selected licence does not. The source read model lives for up to five minutes, so wait for expiry and refresh if necessary. Group events by RunId; parallel workloads can interleave.
customEvents
| where timestamp > ago(24h)
| where name == "LicenceActivityLifecycle"
| where tostring(customDimensions.Stage) in ("CoverageWeek", "WorkloadEvidence")
| extend RunId=tostring(customDimensions.RunId),
Stage=tostring(customDimensions.Stage),
Workload=tostring(customDimensions.Workload)
| project timestamp, RunId, Stage, Workload,
Reason=tostring(customDimensions.Reason),
FromUtc=tostring(customDimensions.FromUtc),
ToUtc=tostring(customDimensions.ToUtc),
MissingDates=tostring(customDimensions.MissingDates),
CoverageStatus=tostring(customDimensions.CoverageStatus),
GroupFiltered=tostring(customDimensions.GroupFiltered),
ExpectedDays=tolong(customMeasurements.ExpectedDays),
PresentDays=tolong(customMeasurements.PresentDays),
Selected=tolong(customMeasurements.Selected),
ExpectedSamples=tolong(customMeasurements.ExpectedSamples),
ObservedSamples=tolong(customMeasurements.ObservedSamples),
UsersWithRows=tolong(customMeasurements.UsersWithRows),
UsersWithActivity=tolong(customMeasurements.UsersWithActivity),
UsersWithCompleteEvidence=tolong(customMeasurements.UsersWithCompleteEvidence),
DroppedEvents=tolong(customMeasurements.DroppedEvents)
| order by RunId asc, timestamp ascCoverageStatus=partial, fewer observed than expected samples, and UsersWithActivity > 0 confirms that the whole-period rule is hiding a frequency classification, not that all usage is absent. Narrowing the selection to complete, settled weeks should make that service measurable. GroupFiltered=true separately means that absence of a person's report rows cannot prove inactivity, even across a complete period.
A missing report date only means no rows are stored for it. Coverage probes for at least one row per day using the report table's date index; it does not have a per-day successful-import marker. An empty successful Graph response or a response whose rows are all excluded can therefore look like a failed import. Conversely, one stored row does not prove that a full day's save finished. These diagnostics expose the current rule without relaxing it or manufacturing zero-activity rows.
To distinguish those causes prospectively, temporarily set the App Service application setting AI_USAGE_REPORT_SAVE_DIAGNOSTICS=true for the Office365ActivityImporter. This activates the existing aggregate save-stage diagnostics; it does not turn on debug or SQL-parameter logging. Allow an import to run. The dated RowsProcessed events report the requested report date, input rows, missing identifiers, out-of-scope rows and added/changed/unchanged rows. Remove the setting afterwards to stop the extra instrumentation.
customEvents
| where timestamp > ago(24h)
| where name == "UsageReportSaveStage"
| where tostring(customDimensions.LoaderType) == "OutlookUserActivityLoader"
| where tostring(customDimensions.Stage) in ("RowsProcessed", "SaveCompleted", "SaveFailed")
| project timestamp,
RunId=tostring(customDimensions.RunId),
Stage=tostring(customDimensions.Stage),
ReportDateUtc=tostring(customDimensions.ReportDateUtc),
Outcome=tostring(customDimensions.Outcome),
ExceptionType=tostring(customDimensions.ExceptionType),
InputRows=tolong(customMeasurements.InputRowCount),
MissingIdentifiers=tolong(customMeasurements.MissingLookupValueRowCount),
OutOfScope=tolong(customMeasurements.OutOfScopeRowCount),
Added=tolong(customMeasurements.AddedRowCount),
Changed=tolong(customMeasurements.ChangedRowCount),
Unchanged=tolong(customMeasurements.UnchangedRowCount)
| order by timestamp ascFor a missing date, RowsProcessed with zero input rows followed by SaveCompleted indicates an empty response was successfully processed, not a failed SQL save. If missing-identifier and out-of-scope counts account for every input row, filtering explains why no rows were written. Zero added/changed rows with nonzero unchanged rows is a normal successful re-import, not missing coverage. SaveFailed identifies a save failure by exception type only. A download failure occurs before saving: inspect the existing importer exception and Loading OutlookUserActivityLoader for date / Finished loading OutlookUserActivityLoader for date traces in the same UTC window.
These events cannot reconstruct an old import, and finalized dates can be skipped on later cycles. No dated event for a day is therefore not proof of failure. Keep customer event exports, raw exceptions, identifiers and actual counts out of public issues, PRs and this wiki; share diagnostic results through an approved private channel.
- Copilot analytics overview
- Copilot Adoption user guide
- Copilot Adoption setup (admins)
- Work Trend Index
- Copilot investment
- Copilot spend
- Agent costs
- Prompt categories
- Copilot credit history (preview)
- Agent 365 package catalog
- The Copilot data in depth
- Prerequisites
- App registrations setup
- Install with the installer
- Verify the deployment
- Security & permissions model
- Private endpoints (optional)
- Certificate authentication (optional)
- Manual installation
- Activity & usage analytics (Power BI)
- SharePoint page tracking