Store JSON Documents in Cosmos DB
  • 18 Sep 2020
  • 1 Minute To Read
  • Contributors
  • Print
  • Comments
  • Share
  • Dark
    Light

Store JSON Documents in Cosmos DB

  • Print
  • Comments
  • Share
  • Dark
    Light

#ServerlessTips - Azure Logic Apps
Author: Steef-Jan Wiggers Azure MVP

Microsoft offers over 300 connectors for Logic App ranging from Azure Service connectors like Service Bus, AI Services and so on to third party SaaS connectors such as ServiceNow, Salesforce, and Mailchimp.

Among the wide range connectors there are also connectors allowing you to store json objects in a storage blob container, or database like a NoSQL Cosmos Database. Therefore, you can use the Azure Blob Storage connector to create a blob (json document) in a container or the Cosmos DB connector to store the document in a what is also called a container. Moreover, by storing json documents in a Cosmos DB container will allow you to query in a collection of JSON documents using a Structured Query Language (SQL).

To use a Cosmos DB connector in a Logic App, you will need an available Cosmos DB instance in your Azure subscription – as you will connect to that instance through the connector. Once you choose a Cosmos DB connector in your Logic App, you will need to specify the action such as ‘Create and update’ a document. Subsequently, you will create a connection to your Cosmos DB Instance.

Logic App Tip 3 - Store json documents in Cosmos DB Picture 1

Once you have the connection set up done you can select the database, collection (container) and document and any additional parameters.
Logic App Tip 3 - Store json documents in Cosmos DB Picture 2

The connector supports various operations, each with additional settings (parameters).

To conclude, the Cosmos DB connector is a versatile connector allowing you to easily store documents without writing any code.

Was This Article Helpful?