# Wednesday, November 7, 2018

In the last article, I showed how to create a new Azure CosmosDB account. In this article, I will show how to add a database with containers to that account.

Navigate to the Azure portal and sign in; then open your Azure CosmosDB account. You may be directed to either the "Quick start" blade (Fig. 1) or the "Overview" blade (Fig. 2)

Fig. 1

Fig. 2

Open the "Data Explorer" blade, as shown in Fig. 3.

Fig. 3

For a newly-created account, no databases are listed.

To create a new database, click the [New Database] button (Fig. 4).

Fig. 4

The "New Database" blade displays, as shown in Fig. 5.

Fig. 5

At the "Database id" field, enter a unique id for your database.

Click the [OK] button.

After a few seconds, a new database will display in the "Data Explorer" blade, as shown in Fig. 6.

Fig. 6

In a CosmosDB database, documents are stored within collections, which help you to organize your data. To create  a new collection, right-click the database and select "New Collection" from the context menu, as shown in Fig. 7

Fig. 7

The "Add Collection" blade displays, as shown in Fig. 8

Fig. 8

At the "Collection Id" field, enter a name for your collection. Collection names must be unique within a database.

Select the appropriate Storage capacity. If you expect to store a small amount of data, select "Fixed"; for databases expected to grow beyond 10GB, select "Unlimited".

If you select unlimited, you can specify a path within each document to find the Partition Key. A Partition Key is used to determine which data to keep together when distributing data across multiple servers.

At the "Throughput" field, enter the number of 1K documents per second you need to process. You will pay more for higher throughput, so consider whether you need a higher throughput before increasing this value.

Click the [OK] button to create the collection.

The new collection will display beneath the database as shown in Fig. 9. You may need to expand the tree in order to see the collection.

Fig. 9

You can write to and read from this collection programmatically or you can upload document within the portal by clicking the [Upload] button, as shown in Fig. 10.

Fig. 10

Data in a CosmosDB account is stored in databases and collections. This article showed how to create these.

Wednesday, November 7, 2018 6:36:00 AM (GMT Standard Time, UTC+00:00)