Azure AI Cloud Developer (AI-200) · Free practice question 4 of 12
Container TTL for chat history
Chat transcripts at Wildmoor Tutors are stored in a Cosmos DB container and must be removed automatically 30 days after their last update, without a cleanup job. What should the developers configure?
- A.Create a change feed processor that deletes old items each night
- B.Set the container's default time to live to 2592000 seconds
- C.Add a composite index on _ts so that old items are removed faster
- D.Set the item's partition key to the creation date and drop old partitions
Show answer and explanation
Correct answer: B. Set the container's default time to live to 2592000 seconds
Why: Time to live in Cosmos DB deletes items automatically once the configured number of seconds has passed since the item's last modification time (_ts); 30 days is 2,592,000 seconds. Expired items are removed in the background with leftover throughput. A nightly processor is the custom job the team wants to avoid, indexes don't delete data, and Cosmos DB has no command to drop a logical partition.
More free Azure AI Cloud Developer (AI-200) questions
- Importing a public image into ACR
- Event-driven Container Apps job
- Horizontal Pod Autoscaler on CPU
- Optimistic concurrency with ETag
- IVFFlat lists and probes tuning
- Entra ID connection to Azure Managed Redis
- Deferring Service Bus messages
- Event Grid system topic for storage events
- NCRONTAB timer trigger schedule
- User-assigned identity shared by apps
- KQL distinct counts with dcount