Search code examples
azureazure-cosmosdbazure-cosmosdb-mongoapi

Enable Analytical Storage Time to Live via CLI


I'm trying to create a collection in Cosmos DB API for MongoDB using the CLI and enable the Analytical Storage Time to Live option with "On (no default)" but the documentation regarding this process (https://learn.microsoft.com/en-us/cli/azure/cosmosdb/mongodb/collection?view=azure-cli-latest#az_cosmosdb_mongodb_collection_create) don't provide any example or valid values that is possible to enter to configure as below:

enter image description here

Does anyone know how to execute the CLI to have the same effect as the UI?


Solution

  • To enable the Analytical Storage Time to Live option with "On (no default)" you need to use -1 value, like:

    --analytical-storage-ttl -1

    If you put a value > 0, it will enable "On" option and sets the seconds of lifetime.