Cosmos DB: Missing Last Key Usage Metadata in Portal Despite Diagnostic Logs Sending Data

Alex Kuzko 0 Reputation points
2026-11-17T18:05:31.0333333+00:00

Problem description

I am experiencing an issue with my Azure Cosmos DB account where the portal does not display the 'Last Key usage' information, even though diagnostic logs are successfully sent to Log Analytics. I have enabled diagnostic logging and verified that logs are arriving, but the portal still shows no key usage data. I want to understand why the portal does not reflect this metadata and how it relates to diagnostic logs.

Environment

Azure Cosmos DB account using account keys, region not specified, with diagnostic logs sent to Log Analytics.

What I've already tried

I checked the affected Cosmos DB account in the Azure portal for 'Last Key usage' information, which was missing. I tested the account with Safe Key Rotation both disabled and enabled; in both cases, the portal did not show key-usage details. I confirmed that diagnostic data is successfully sent to Log Analytics, indicating that logging is working correctly. I compared this account with older Cosmos DB accounts where key usage is visible, and noted that the behavior differs.

Current status

The 'Last Key usage' metadata remains absent in the portal despite diagnostic logs showing activity. I seek clarification on why this metadata is not being populated for my account and how it correlates with the diagnostic data. Any guidance on troubleshooting or expected behavior would be appreciated.

Azure Cosmos DB
Azure Cosmos DB

An Azure NoSQL database service for app development.

0 comments No comments

1 answer

Sort by: Oldest
  1. Zoha Fatima 675 Reputation points
    2026-11-18T14:52:59.5866667+00:00

    Hi, Alex,

    Cosmos DB tracks when account keys were last used separately from the diagnostic logs it sends to Log Analytics. Safe Key Rotation uses that tracking to check whether a key is still in use. Turning it on does not start tracking or explain why the portal field is blank.

    To verify key activity, make a successful read using a known account key and note the time in UTC. For Direct mode, check CDBDataPlaneRequests in Log Analytics. The KeyType column can identify the primary or secondary key used. For Gateway mode, AuthTokenType shows the gateway’s authorization type and may not identify the specific account key. If the portal still shows no timestamp after confirmed key use, send Azure Support the account resource ID, request activity ID, and timestamp so they can investigate. A blank field alone is not evidence that the key is unused.

    Thank you, and feel free to reply if you need more help.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.