---
title: "Integration with Cosmos DB"
slug: "integration-with-cosmos-db"
description: "This document provides a walkthrough for setting up the MongoDB Module for integration with ComsmosDB. It does so by explaining how to configure the integration in Azure as well as Decisions. "
updated: 2025-06-17T20:43:47Z
published: 2025-06-17T20:43:47Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration with Cosmos DB

## Overview

The MongoDB Module can be configured to integrate with a Cosmos database.

The **MongoDB Module will need to be installed. To**learn how to install a module, click [here](https://documentation.decisions.com/v9/docs/installing-modules-decisions).

## Example

This example will demonstrate how to integrate the MongoDB Module with a Cosmos database.

1. When setting up the configuration for Azure, be sure that the CosmosDB API is set to **Azure Cosmos DB****for** **MongoDB API.**  
**![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1616694152683.png)**
2. Under **Review + create**, click **Create.**  
**![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1616694389026.png)**
3. After the Cosmos DB has been deployed, go to **Connection String** and copy the **Primary Connection String**.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1616695286583.png)![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-08-15_10h45_51.png)
4. In the **Edit Entity** dialog window, enter a name for the server. Select the checkbox for **Get Database Name from Flow**, **Get Collection Name from Flow**, and **Choose Document Type on Step**and paste in the Connection String from Azure. Then, click OK.The **Database** and **Collection Name** can be configured within the Flow. **If it does not exist, it will be created.**

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-08-15_10h47_33.png)
5. In a Designer Project, click CREATE DATATYPES/INTEGRATION from the **Global Action Bar**and select **Database Structure**.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-08-15_10h48_56.png)
6. Enter a name for the **Structure Type Name** and add two **String [Text]**data members (Field1, Field2). Then, click SAVE.If creating a Flow Structure, it should include a field called id.

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-08-15_10h49_35.png)
7. Click CREATE FLOW from the Global Action Bar and select **Flow**. Name the Flow (CosmosDB Flow) and click CREATE.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-08-15_10h50_25.png)
8. On the **Start**step click the **Done**path and navigate to **Integrations > All Integrations > MongoDB > AzureCosmosDB**. Select the**Insert Document** step and click ADD.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-17_16h32_26.png)
9. With the Insert Document step selected, click the **Document Type**dropdown list under the SETTINGS category on the **Properties**panel. Navigate to **User Defined Types > Database Structures** and select **TestCosmosDB**. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-17_16h36_16.png)
10. Enter a constant value in the **Collection Name** and **Database Name**fields. Select **Unknown**next to the **Document**field and select **Build Data**. Change the mapping type of the **ID**, **Field1**, and **Field2**to **Constant**and enter values. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-17_16h39_44.png)
11. Connect the **Success**path to the **End**step. Then, click **Save**to save changes to the Flow. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-17_16h41_58.png)

## Debug

1. On the top action bar, click **Debug**. Then, click START DEBUGGING.
2. After the debugger runs, click on the Insert Document step. Click **Execution 1**and select **View Input/Output Data** to view the data.
3. To verify the connection, navigate back to Azure. Then, navigate to **Data Explorer > [DATABASE NAME] > [COLLECTION NAME]**and click **Documents**.
