You manage an Azure Cosmos DB SQL API container that stores event documents. By default, events must be deleted after 7 days. Certain audit events must be kept for 90 days, and a small set of documents must never expire. What should you configure to meet all requirements with minimal code?
Choose an answer
Tap an option to check your answer.
Correct answer: Enable TTL on the container and set the default TTL to 604800 seconds (7 days)., For audit documents, set a per-item "ttl" property of 7776000 seconds (90 days)., For documents that must not expire, set a per-item "ttl" property of -1..
Why this is the answer
Azure Cosmos DB's Time-to-Live (TTL) feature is designed for automatic document expiration. Enabling TTL on the container and setting a default of 604800 seconds (7 days) ensures most documents expire as required. For audit documents needing a longer retention, a per-item ttl property can override the container's default, setting it to 7776000 seconds (90 days). Documents that should never expire can also override the default by setting their per-item ttl property to -1. This approach uses built-in Cosmos DB functionality, minimizing custom code. Disabling TTL and using the change feed would require custom logic for deletion, which is more complex. The indexing policy is unrelated to document expiration.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed