Configure throughput for Azure Cosmos DB for NoSQL with the Azure portal

One of the most important things to wrap your head around is configuring throughput in Azure Cosmos DB for NoSQL. To create an Azure Cosmos DB for NoSQL container, you must first create an account and then a database; in that order.

In this lab, you will provision throughput using various methods in the Data Explorer. You will provision throughput either manually or using autoscale, at the database and the container level.

Create a serverless account

Let’s start simple by creating a serverless account. There’s not much to configure here since everything is serverless. When we create our database and container, we don’t have to provision throughput at all. You will see all of that as we step into creating this account.

  1. In a new web browser window or tab, navigate to the Azure portal (portal.azure.com).

  2. Sign into the portal using the Microsoft credentials associated with your subscription.

  3. Within the Azure services category, select Create a resource, and then select Azure Cosmos DB.

    💡 Alternatively; expand the menu, select All Services, in the Databases category, select Azure Cosmos DB, and then select Create.

  4. In the Select API option pane, select the Create option within the Azure Cosmos DB for NoSQL section.

  5. Within the Create Azure Cosmos DB Account pane, observe the Basics tab.

  6. On the Basics tab, enter the following values for each setting:

    Setting Value
    Subscription Use your existing Azure subscription. All resources must belong to a resource group. Every resource group must belong to a subscription.
    Resource Group Use existing or create a new resource group. All resources must belong to a resource group.
    Account Name Enter any globally unique name. The globally unique account name. This name will be used as part of the DNS address for requests. The portal will check the name in real time.
    Location Choose any available region. Select the geographical region from which your database will initially be hosted.
    Capacity mode Select Serverless
  7. Select Review + Create to navigate to the Review + Create tab, and then select Create.

    📝 It can take 10-15 minutes for the Azure Cosmos DB for NoSQL account to be ready for use.

  8. Observe the Deployment pane. When the deployment is complete, the pane will update with a Deployment successful message.

  9. Still within the Deployment pane, select Go to resource.

  10. From within the Azure Cosmos DB account pane, select Data Explorer from the resource menu.

  11. In the Data Explorer pane, expand New Container and then select New Database.

  12. In the New Database popup, enter the following values for each setting, and then select OK:

    Setting Value
    Database id cosmicworks
  13. Back in the Data Explorer pane, observe the cosmicworks database node within the hierarchy.

  14. In the Data Explorer pane, select New Container.

  15. In the New Container popup, enter the following values for each setting, and then select OK:

    Setting Value
    Database id Use existing | cosmicworks
    Container id products
    Partition key /categoryId
  16. Back in the Data Explorer pane, expand the cosmicworks database node and then observe the products container node within the hierarchy.

  17. Return to the Home of the Azure portal.

Create a provisioned account

Now, we are going to create a provisioned throughput account with more traditional configuration options. This type of account will open up a world of configuration options for us which can be a bit overwhelming. We are going to walk through a few examples of database and container pairings that are possible here.

  1. Within the Azure services category, select Create a resource, and then select Azure Cosmos DB.

    💡 Alternatively; expand the menu, select All Services, in the Databases category, select Azure Cosmos DB, and then select Create.

  2. In the Select API option pane, select the Create option within the Azure Cosmos DB for NoSQL section.

  3. Within the Create Azure Cosmos DB Account pane, observe the Basics tab.

  4. On the Basics tab, enter the following values for each setting:

    Setting Value
    Subscription Use your existing Azure subscription. All resources must belong to a resource group. Every resource group must belong to a subscription.
    Resource Group Use existing or create a new resource group. All resources must belong to a resource group.
    Account Name Enter any globally unique name. The globally unique account name. This name will be used as part of the DNS address for requests. The portal will check the name in real time.
    Location Choose any available region. Select the geographical region from which your database will initially be hosted.
    Capacity mode Provisioned throughput
    Apply Free Tier Discount Do Not Apply
    Limit the total amount of throughput that can be provisioned on this account Unchecked
  5. Select Review + Create to navigate to the Review + Create tab, and then select Create.

    📝 It can take 10-15 minutes for the Azure Cosmos DB for NoSQL account to be ready for use.

  6. Observe the Deployment pane. When the deployment is complete, the pane will update with a Deployment successful message.

  7. Still within the Deployment pane, select Go to resource.

  8. From within the Azure Cosmos DB account pane, select Data Explorer from the resource menu.

  9. In the Data Explorer pane, expand New Container and then select New Database.

  10. In the New Database popup, enter the following values for each setting, and then select OK:

    Setting Value
    Database id nothroughputdb
    Provision throughput Unchecked
  11. Back in the Data Explorer pane, observe the nothroughputdb database node within the hierarchy.

  12. In the Data Explorer pane, select New Container.

  13. In the New Container popup, enter the following values for each setting, and then select OK:

    Setting Value
    Database id Use existing | nothroughputdb
    Container id requiredthroughputcontainer
    Partition key /primarykey
    Container throughput Manual
    RU/s 400
  14. Back in the Data Explorer pane, expand the nothroughputdb database node and then observe the requiredthroughputcontainer container node within the hierarchy.

  15. In the Data Explorer pane, expand New Container and then select New Database.

  16. In the New Database popup, enter the following values for each setting, and then select OK:

    Setting Value
    Database id manualthroughputdb
    Provision throughput Checked
    Database throughput Manual
    RU/s 400
  17. Back in the Data Explorer pane, observe the manualthroughputdb database node within the hierarchy.

  18. In the Data Explorer pane, select New Container.

  19. In the New Container popup, enter the following values for each setting, and then select OK:

    Setting Value
    Database id Use existing | manualthroughputdb
    Container id childcontainer
    Partition key /primarykey
    Provision dedicated throughput for this container Checked
    Container throughput Manual
    RU/s 1000
  20. Back in the Data Explorer pane, expand the manualthroughputdb database node and then observe the childcontainer container node within the hierarchy.