Created
September 1, 2020 16:25
-
-
Save tombiddulph/6c7beb668c36c8c3a455bb431fa560e1 to your computer and use it in GitHub Desktop.
Configuring Cosmos throughput
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CosmosClient client = new CosmosClient(connectionString); | |
| Database db = client.GetDatabase("test-db"); | |
| Container container = db.GetContainer("test-container"); | |
| const int rus = 1000; | |
| ThroughputResponse manualDbThroughput = await db.ReplaceThroughputAsync(ThroughputProperties.CreateManualThroughput(rus)); | |
| ThroughputResponse autoDbThroughput = await db.ReplaceThroughputAsync(ThroughputProperties.CreateAutoscaleThroughput(rus)); | |
| ThroughputResponse manualContainerThroughput = await container.ReplaceThroughputAsync(ThroughputProperties.CreateManualThroughput(rus)); | |
| ThroughputResponse autoContainerThroughput = await container.ReplaceThroughputAsync(ThroughputProperties.CreateAutoscaleThroughput(rus)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this. However when I try to change from "Manual" to "Autoincrement" for a database, I get a 400 error. This is the error message I am getting: