Create Multiple Cosmos DB Containers

45 minutes
  • 3 Learning Objectives

About this Hands-on Lab

Cosmos DB is a multi-master, multi-model, NoSQL database service built for planet scale (the hint is in the name: Cosmos!). In this hands-on lab, we’ll use the Azure Portal to create a Cosmos DB account and two collections. By the end of the beginner hands-on lab, you’ll have a good understanding of how Cosmos DB is structured, and the importance of the Cosmos DB API, and throughput configuration. The objectives for this hands-on lab can be completed using the Azure Portal. As this is a beginner hands-on lab, no development or MongoDB tools will be required.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a Cosmos DB Account
  1. Create a new Cosmos DB Account (note: the account name must be unique).
  2. Ensure the API meets the requirements.
Create Two Cosmos DB Collections
  1. Create a new database in Cosmos DB.
  2. Ensure the throughput meets the requirements.
  3. Create two new collections:
    a. Collection 1: "profiles" (use any shard key, for example "country")
    b. Collection 2: "posts" (use any shard key, for example "userId")
Optional: Create and View Data
  1. Add some basic data with Data Explorer (Portal).
  2. View the newly created data within Data Explorer (Portal).

Additional Resources


You've recently been employed as a cloud developer and have been asked to prepare for a migration of an existing social media application to Azure.

To prepare for the migration of this application, you have several mandatory requirements:

  • Configure a Cosmos DB account with two collections
  • Ensure that the Cosmos DB account supports your existing MongoDB application
  • Ensure that throughput is distributed centrally for both collections

If it is possible, you have been also asked to support the following non-mandatory requirements using the new Cosmos DB account:

  • Support SQL-like queries

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?