Mid Azure

How do you enable consistency levels in Cosmos DB?

  • Cosmos DB supports Strong, Bounded Staleness, Session, Consistent Prefix,

Eventual.

  • Set consistency when creating CosmosClient:

var clientOptions = new CosmosClientOptions

ConsistencyLevel = ConsistencyLevel.Session

var cosmosClient = new CosmosClient(endpointUri, primaryKey,

clientOptions);

More from Microsoft Azure Tutorial

All questions for this course