Error with enabling analytical storage ttl for existing collection on Azure Cosmos DB for MongoDB account

Zalim 0 Reputation points
2025-10-09T11:59:24.2+00:00

Hi All,

I've been trying to set a value for the analytical-storage-ttl parameter in one of my existing collections on MongoDB. However I seem to be getting an error regarding an internal server error and I'm not quite sure why.

I am using the MongoDB Collection Update command line from this resource https://free.blessedness.top/en-us/cli/azure/cosmosdb/mongodb/collection?view=azure-cli-latest#az-cosmosdb-mongodb-collection-list. And following instructions from this resource https://free.blessedness.top/en-us/azure/cosmos-db/configure-synapse-link#analyze-with-powerbi, which states this feature can be done on MongoDB.

I've also checked that my collection exists and that analytical storage is enabled. Any help on this would be extremely useful as I am trying to create a synapse link to view my data on Powerbi, and the current MongoDB connector (v2) on PowerBI does not support advanced schemas.

Thanks!

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
{count} votes

1 answer

Sort by: Most helpful
  1. Alex Burlachenko 18,390 Reputation points Volunteer Moderator
    2025-10-09T12:54:45.7733333+00:00

    hi Zalim,

    you're following the right documentation, but hitting an internal server error when trying to enable analytical storage ttl. this usually points to a backend issue or a specific limitation with your existing collection.

    let's double check the prerequisites. analytical storage for cosmos db for mongodb requires the account to be using mongoDB version 3.6 or higher. please verify your account's server version in the azure portal.

    another common pitfall is the collection's sharding key. for analytical storage to work, the collection must be sharded. if it's an unsharded collection, the operation might fail. you can check this in the data explorer. if both of those are correct, the internal error might be due to the collection's current state or size. sometimes, there's a temporary provisioning issue.

    as a workaround, try creating a new collection with the analytical storage ttl enabled from the start. use the az cosmosdb mongodb collection create command with the --analytical-storage-ttl parameter set. if this works, you could then migrate your data from the old collection to the new one.

    if the new collection also fails, this strongly suggests a platform side issue or a regional limitation. your best course of action is to contact azure support. they can check the backend logs for your specific account and collection to see the exact cause of the internal server error.

    verify your mongoDB version and that the collection is sharded. if all looks good, try creating a new collection with analytical ttl enabled. if that also fails, contact support.

    regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    

    https://ctrlaltdel.blog/


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.