- Lab
- A Cloud Guru
Deploying an Azure Cosmos DB Instance
As modern, cloud-based apps have evolved, they've required data storage to adapt with them. Often the exact schema needed is not known up front and will probably change over time. Services such as Azure Cosmos DB have risen to the challenge to meet this need, providing multi-model, globally distributed, efficient NoSQL databases. In this hands-on lab scenario, you are the DBA for Awesome Company. A new video game is in development that will require a cloud database backend. Your solution will need to have the ability to replicate globally as the game is released to new countries, maintain fast and consistent performance so that there is no game lag, and have guaranteed availability so players can game whenever they want. Performing the actions of this lab will help you become familiar with how to deploy Azure Cosmos DB. **Note:** *It will take a significant amount of time for the deployment to finish. Please allot at least an hour for total lab time.*
Path Info
Table of Contents
-
Challenge
Log in to the Azure Portal
Log in to the Azure Portal using the provided credentials.
-
Challenge
Create an Azure Cosmos DB Account
- Click the three-line menu icon in the top left corner of the page, and click Azure Cosmos DB.
- Click Add.
- Select the resource group the lab created for you.
- Provide an account name (must be unique).
- For API, leave it as Core(SQL).
- For Apply Free Tier Discount, click Do Not Apply.
- For Location, select the region (US) West US.
- Leave all the other values at their defaults, and click Review + create.
- Verify all is well, and click Create.
- Once the deployment is complete, click Go to resource.
Note: The deployment could take up to 15 minutes. Feel free to carry out other tasks while you wait. Also, at times the deployment screen does not accurately report that it is finished. To mitigate this, check the status on the resource's overview page.
-
Challenge
Create the Database and Container
- Click on Data Explorer in the left-hand menu.
- Click New Container.
- Enter the following values:
- Database id: Players
- Container id: Profiles
- Partition key: /team
- Leave all other values at their defaults, and click OK.
-
Challenge
Add Items to the Database
-
Expand the Players database, expand Profiles, and click on Items.
-
Click New Item.
-
Enter the following text into the document area on the right:
{ "id": "1", "team": "blue", "gamerTag": "Lando Commando", "statusMessage": "glhf :)", "isOnline": true }
-
Click Save.
-
Repeat the above steps with the following values:
id
:2
team
:red
gamerTag
:delmarDB
statusMessage
:select * from victory
isOnline
:false
-
-
Challenge
Query the Items
-
By default, all your items are selected.
-
Click Edit Filter.
-
Replace the default query with the following:
WHERE c.team = 'red'
-
Notice only our red team member is returned.
-
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.