Skip to main content

Provisioning a Cosmos DB Instance in Azure

Hands-On Lab

 

Photo of Brian  Roehm

Brian Roehm

Azure Training Architect I in Content

Length

01:00:00

Difficulty

Beginner

In this hands-on lab, we will learn how to provision and configure a Cosmos DB instance in the Azure portal.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Provisioning a Cosmos DB Instance in Azure

Introduction

In this hands-on lab, we will learn how to provision and configure a Cosmos DB instance in the Azure portal.

Connect to the Lab

  1. On the main lab page, click the Open Azure Portal button.
  2. Enter the username that was provided for you in the Credentials section of the lab instructions page.
  3. Click Next.
  4. Enter the password that was provided for you in the Credentials section of the lab instructions page.
  5. Click Next.
  6. In the Welcome menu, click Maybe later.

Create a Cosmos DB Instance in the Azure Portal

  1. From the Azure dashboard, type "Cosmos DB" in the search bar at the top of the page.
  2. Choose Azure Cosmos DB from the dropdown.
  3. Click + Add or Create Azure Cosmos DB account.
  4. On the Create Azure Cosmos DB Account page, configure the following settings:
    • Resource Group: (Select the existing resource group.)
    • Account Name: (Enter a unique name.)
    • API: Core (SQL)
    • Location: (US) Central US
    • Geo-Redundancy: Enable
    • Multi-region Writes: Disable
  5. Click Next : Network >.
  6. Click Next : Tags >.
  7. Click Next : Review + create >.
  8. Click Create.

Configure Cosmos DB

  1. When the deployment is complete, click Go to resource.
  2. In the left navigation menu, click Replicate data globally.
  3. Locate the West US region, and click the corresponding circle on the map to select it.
  4. Click Save.
  5. Wait for a notification that the region configuration operation is complete.
  6. In the left navigation menu, click Default consistency.
  7. Select EVENTUAL.
  8. Click Save.
  9. Wait for a notification that the consistency configuration operation is complete.
  10. In the left navigation menu, click Quick start.
  11. In the .NET tab, click Create 'Items' container.
  12. Click Open Data Explorer.
  13. In the SQL API menu, click Scale & Settings.
  14. Under Indexing Policy, locate the indexingMode parameter, and change its value to lazy.
    "indexingMode": "lazy",
  15. Click Save.
  16. In the left navigation menu, click Alerts.
  17. Click + New Alert Rule.
  18. Under CONDITION, click Add.
  19. Under SIGNAL NAME, select Index Usage.
  20. Under Threshold, configure the following settings:
    • Operator: Greater than
    • Aggregation type: Total
    • Threshold value: 1000
  21. Click Done.
  22. Under ACTIONS, click Add.
  23. Click Select action group.
  24. Click the checkbox next to Application Insights Smart Detection.
  25. Click Select.
  26. Click Done.
  27. Under ALERT DETAILS, configure the following settings:
    • Alert rule name: Index Usage Greater than 1000
    • Severity: Sev 2
    • Enable rule upon creation: Yes
  28. Click Create alert rule.

Conclusion

Congratulations, you've successfully completed this hands-on lab!