A community member has associated this post with a similar question:
How to get logs of item deletion past TTL in CosmosDB?

Only moderators can edit this content.

Help Needed on Tracking Deletions in Change Feed

Catherine Du 25 Reputation points Microsoft Employee
2024-07-11T23:30:47.8266667+00:00

Our service currently stores metadata in Cosmos DB with a retention of 24 hours. We have set out TTL to be 18h in the configuration, but we need to track deletion records for compliance reasons. 

We came across the Change feed modes in Azure Cosmos DB | Microsoft Learn All Versions and Deletes Mode which contains a "timeToLiveExpired" field. Given the information from your documentation that "Deletes from TTL expirations aren't guaranteed to appear in the feed immediately after the item expires. They appear when the item is purged from the container", how can we track whether the deletion has occurred within retention? Since this mode is on based on a Pull model, is it still possible to get the precise timestamp of when the item is definitely purged? 

In the Latest Version mode, you recommend setting a tombstone flag "deleted" with the value true. How does the change feed capture it as an update when the TTL has expired? Does it appear in the Change feed when the item is purged or just upon TTL expiration?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,680 questions
{count} votes