How to use Azure Cosmos DB in .Net

Author Topic: How to use Azure Cosmos DB in .Net  (Read 1766 times)

Offline Tapushe Rabaya Toma

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • University Webpage
How to use Azure Cosmos DB in .Net
« on: May 09, 2018, 06:08:32 PM »
Azure Cosmos DB is an easy-to-use, scalable, NoSQL database available in Microsoft’s Azure cloud. Cosmos DB is hosted on SSDs and hence data storage and retrieval is very fast. This database service also supports multiple data models including document, key-value, graph, and columnar, so can be leveraged for all kinds of applications. We will focus on Cosmos DB’s document data model, which is accessed through the SQL API (formerly known as the DocumentDB API).

Similar to MongoDB and RavenDB, the document data model in Azure Cosmos DB allows you to store data represented as JSON without an enforced schema. In this article I will discuss the use of Azure Cosmos DB as a JSON document store and how we can work with it in .Net.
Getting started with Azure Cosmos DB
First create a free Microsoft Azure account if you don’t have one. Next, create and configure an Azure Cosmos DB account from the Azure portal. When creating an Azure Cosmos DB account, you will be prompted to select any one of the five API options: Gremlin (graph database), MongoDB (document database), SQL (document database), Cassandra (columnar database), and Azure Table (key-value store). Select SQL as the API for your Azure Cosmos DB account. You can take a look at this Microsoft Quickstart to learn how to configure Azure Cosmos DB with the SQL API.

Now that you have your Cosmos DB account, create a new console application project in Visual Studio and save it with a name. Next, select the project in the Solution Explorer window and install the Microsoft.Azure.DocumentDB .Net client library in your project from the NuGet Package Manager window. Alternatively, you can install this library via the NuGet Package Manager console using the following command.

Offline Asif Khan Shakir

  • Full Member
  • ***
  • Posts: 123
  • Test
    • View Profile
Re: How to use Azure Cosmos DB in .Net
« Reply #1 on: July 06, 2019, 03:02:22 AM »
Nice

Offline lamisha

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Re: How to use Azure Cosmos DB in .Net
« Reply #2 on: July 08, 2019, 01:55:25 AM »
thanks for sharing.

Offline maruf.swe

  • Sr. Member
  • ****
  • Posts: 472
  • Test
    • View Profile
Re: How to use Azure Cosmos DB in .Net
« Reply #3 on: February 26, 2020, 12:51:56 AM »
Good post, thanks for sharing.

Offline moyez

  • Newbie
  • *
  • Posts: 12
  • Test
    • View Profile
Re: How to use Azure Cosmos DB in .Net
« Reply #4 on: February 28, 2020, 03:14:32 AM »
Good Post

Offline SSH Shamma

  • Sr. Member
  • ****
  • Posts: 364
    • View Profile
Re: How to use Azure Cosmos DB in .Net
« Reply #5 on: February 29, 2020, 07:44:08 PM »
Thanks for sharing
Syeda Sumbul Hossain
Lecturer, SWE
Daffodil International University
Contact No. 01918455555

Offline Raihana Zannat

  • Sr. Member
  • ****
  • Posts: 392
  • Test
    • View Profile
Re: How to use Azure Cosmos DB in .Net
« Reply #6 on: March 01, 2020, 04:07:56 PM »
Thank you for sharing
Raihana Zannat
Senior Lecturer
Dept. of Software Engineering
Daffodil International University
Dhaka, Bangladesh