You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The typical student doing this lab is going to be using the Free Tier of Cosmos DB. This allows him to use up with 1000 RUs for free.
However, if this is the case, the lab will not run, as each container consumes 400 provisioned throughput , so only the first database is created, and the first two containers and it then fails.
Repro steps: Run the lab using the Free Tier of Cosmos DB.
Here is how I resolved this:
Line 760:
string folder = "data" + Path.DirectorySeparatorChar + databaseName;
var throughputProperties = ThroughputProperties.CreateManualThroughput(1000);
Database database = await client.CreateDatabaseIfNotExistsAsync(databaseName, throughputProperties);
This will allow all containers to share the same 1000 RS's, and the code will not error out.
Line 772: Do not set a throughput on the container, as it inherits this from the Database:
//ContainerProperties containerProperties = new ContainerProperties(containerName, "/id");
Container container = await database.CreateContainerIfNotExistsAsync(containerName, "/id");
// containerProperties: containerProperties,
// throughputProperties: ThroughputProperties.CreateAutoscaleThroughput(autoscaleMaxThroughput: 4000)
//);
However, you can still only create one database at a time. When I did the labs, I created version 1 did the labs for it, and then deleted it again and created database-v2 and so on. Not sure how else to approach this.
Hope this helps.
The text was updated successfully, but these errors were encountered:
Module: 420
Lab/Demo: 16/17
Description of issue
The typical student doing this lab is going to be using the Free Tier of Cosmos DB. This allows him to use up with 1000 RUs for free.
However, if this is the case, the lab will not run, as each container consumes 400 provisioned throughput , so only the first database is created, and the first two containers and it then fails.
Repro steps: Run the lab using the Free Tier of Cosmos DB.
Here is how I resolved this:
Line 760:
string folder = "data" + Path.DirectorySeparatorChar + databaseName;
var throughputProperties = ThroughputProperties.CreateManualThroughput(1000);
Database database = await client.CreateDatabaseIfNotExistsAsync(databaseName, throughputProperties);
This will allow all containers to share the same 1000 RS's, and the code will not error out.
Line 772: Do not set a throughput on the container, as it inherits this from the Database:
//ContainerProperties containerProperties = new ContainerProperties(containerName, "/id");
Container container = await database.CreateContainerIfNotExistsAsync(containerName, "/id");
// containerProperties: containerProperties,
// throughputProperties: ThroughputProperties.CreateAutoscaleThroughput(autoscaleMaxThroughput: 4000)
//);
However, you can still only create one database at a time. When I did the labs, I created version 1 did the labs for it, and then deleted it again and created database-v2 and so on. Not sure how else to approach this.
Hope this helps.
The text was updated successfully, but these errors were encountered: