{"id":28152,"date":"2020-12-24T11:42:38","date_gmt":"2020-12-24T11:42:38","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=28152"},"modified":"2020-12-24T11:42:38","modified_gmt":"2020-12-24T11:42:38","slug":"create-an-azure-cosmos-account","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/","title":{"rendered":"Create an Azure Cosmos account"},"content":{"rendered":"\n<p><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/exam-dp-200-implementing-an-azure-data-solution\/\" target=\"_blank\" rel=\"noreferrer noopener\">Go back to DP-200 Tutorials<\/a><\/p>\n\n\n\n<p>In this we will learn about how to use the Azure portal to create an Azure Cosmos DB SQL API account, create a document database, and container, and add data to the container. However, Azure Cosmos DB is Microsoft&#8217;s globally distributed multi-model database service. You can use Azure Cosmos DB to quickly create and query key\/value databases, document databases, and graph databases.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Create an Azure Cosmos DB account<\/strong><\/h3>\n\n\n\n<p>Go to the Azure portal to create an Azure Cosmos DB account. Search for and select Azure Cosmos DB.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/media\/create-cosmosdb-resources-portal\/find-nosql-cosmosdb-marketplace.png\" alt=\"The Azure portal Databases pane\"\/><figcaption>Image Source: Microsoft<\/figcaption><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, select Add.<\/li><li>Secondly, on the Create Azure Cosmos DB Account page, enter the basic settings for the new Azure Cosmos account.<\/li><li>Thirdly, select Review + create. You can skip the Network and Tags sections.<\/li><li>Then, review the account settings, and then select Create. It takes a few minutes to create the account. Wait for the portal page to display Your deployment is complete.<\/li><li>Lastly, select Go to resource to go to the Azure Cosmos DB account page.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Add a database and a container<\/strong><\/h4>\n\n\n\n<p>You can use the Data Explorer in the Azure portal to create a database and container.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, select Data Explorer from the left navigation on your Azure Cosmos DB account page, and then select New Container.<\/li><li>Secondly, in the Add container pane, enter the settings for the new container.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"685\" height=\"400\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/12\/commands-6-685x400.png\" alt=\"Create an Azure Cosmos account\" class=\"wp-image-28164\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/12\/commands-6-685x400.png 685w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/12\/commands-6.png 949w\" sizes=\"auto, (max-width: 685px) 100vw, 685px\" \/><figcaption>Image Source: Microsoft<\/figcaption><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>Lastly, select ok. The Data Explorer displays the new database and the container that you created.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.testpreptraining.ai\/implementing-an-azure-data-solution-dp-200-free-practice-test\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"150\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-pracice-tests-1.png\" alt=\"DP-200 practice tests\" class=\"wp-image-18535\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-pracice-tests-1.png 961w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-pracice-tests-1-750x117.png 750w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/a><\/figure><\/div>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Add data to your database<\/strong><\/h4>\n\n\n\n<p>Add data to your new database using Data Explorer.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, in Data Explorer, expand the ToDoList database, and expand the Items container. Next, select Items, and then select New Item.<\/li><li>Secondly, add the following structure to the document on the right side of the Documents pane:<\/li><\/ul>\n\n\n\n<p><strong>JSON<\/strong><br><em>{<br>&#8220;id&#8221;: &#8220;1&#8221;,<br>&#8220;category&#8221;: &#8220;personal&#8221;,<br>&#8220;name&#8221;: &#8220;groceries&#8221;,<br>&#8220;description&#8221;: &#8220;Pick up apples and strawberries.&#8221;,<br>&#8220;isComplete&#8221;: false<br>}<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Then, select Save.<\/li><li>Lastly, select New Document again, and create and save another document with a unique id, and any other properties and values you want. <\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Query your data<\/strong><\/h4>\n\n\n\n<p>You can use queries in Data Explorer to retrieve and filter your data.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, at the top of the Items tab in Data Explorer, review the default query SELECT * FROM c. This query retrieves and displays all documents from the container ordered by ID.<\/li><li>Secondly, to change the query, select Edit Filter, replace the default query with ORDER BY c._ts DESC, and then select Apply Filter.<\/li><\/ul>\n\n\n\n<p>The modified query displays the documents in descending order based on their time stamp, so now your second document is listed first.<\/p>\n\n\n\n<p>However, if you&#8217;re familiar with SQL syntax, you can enter any supported SQL queries in the query predicate box. You can also use Data Explorer to create stored procedures, UDFs, and triggers for server-side business logic. As data explorer provides easy Azure portal access to all of the built-in programmatic data access features available in the APIs.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Clean up resources<\/strong><\/h4>\n\n\n\n<p>When you&#8217;re done with your app and Azure Cosmos DB account, you can delete the Azure resources you created so you don&#8217;t incur more charges. To delete the resources:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, in the Azure portal Search bar, search for and select Resource groups.<\/li><li>Secondly, from the list, select the resource group you created for this quickstart.<\/li><li>Thirdly, on the resource group Overview page, select Delete resource group.<\/li><li>Lastly, in the next window, enter the name of the resource group to delete, and then select Delete.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.testpreptraining.ai\/implementing-an-azure-data-solution-dp-200-practice-exam\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"150\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-online-course-1.png\" alt=\"Create an Azure Cosmos account DP-200 Online course\" class=\"wp-image-18534\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-online-course-1.png 961w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-online-course-1-750x117.png 750w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-right\"><strong>Reference: <\/strong><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/create-cosmosdb-resources-portal\" target=\"_blank\" rel=\"noreferrer noopener\">Microsoft Documentation<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/exam-dp-200-implementing-an-azure-data-solution\/\" target=\"_blank\" rel=\"noreferrer noopener\">Go back to DP-200 Tutorials<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go back to DP-200 Tutorials In this we will learn about how to use the Azure portal to create an Azure Cosmos DB SQL API account, create a document database, and container, and add data to the container. However, Azure Cosmos DB is Microsoft&#8217;s globally distributed multi-model database service. You can use Azure Cosmos DB&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-28152","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create an Azure Cosmos account - Testprep Training Tutorials<\/title>\n<meta name=\"description\" content=\"Enhance your skills by learning about Create an Azure Cosmos account using Microsoft DP-200 online course and Practice Exam Now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create an Azure Cosmos account - Testprep Training Tutorials\" \/>\n<meta property=\"og:description\" content=\"Enhance your skills by learning about Create an Azure Cosmos account using Microsoft DP-200 online course and Practice Exam Now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"og:image\" content=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/media\/create-cosmosdb-resources-portal\/find-nosql-cosmosdb-marketplace.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/\",\"name\":\"Create an Azure Cosmos account - Testprep Training Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2020-12-24T11:42:38+00:00\",\"dateModified\":\"2020-12-24T11:42:38+00:00\",\"description\":\"Enhance your skills by learning about Create an Azure Cosmos account using Microsoft DP-200 online course and Practice Exam Now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create an Azure Cosmos account\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create an Azure Cosmos account - Testprep Training Tutorials","description":"Enhance your skills by learning about Create an Azure Cosmos account using Microsoft DP-200 online course and Practice Exam Now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/","og_locale":"en_US","og_type":"article","og_title":"Create an Azure Cosmos account - Testprep Training Tutorials","og_description":"Enhance your skills by learning about Create an Azure Cosmos account using Microsoft DP-200 online course and Practice Exam Now!","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/","og_site_name":"Testprep Training Tutorials","og_image":[{"url":"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/media\/create-cosmosdb-resources-portal\/find-nosql-cosmosdb-marketplace.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/","name":"Create an Azure Cosmos account - Testprep Training Tutorials","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2020-12-24T11:42:38+00:00","dateModified":"2020-12-24T11:42:38+00:00","description":"Enhance your skills by learning about Create an Azure Cosmos account using Microsoft DP-200 online course and Practice Exam Now!","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/create-an-azure-cosmos-account\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Create an Azure Cosmos account"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/28152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=28152"}],"version-history":[{"count":7,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/28152\/revisions"}],"predecessor-version":[{"id":28216,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/28152\/revisions\/28216"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=28152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=28152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=28152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}