Azure Cosmos DB for MongoDB account (RU) CRUD in Logicapps

Shankar Naganathan 0 Reputation points
2025-01-16T13:36:04.2766667+00:00

Hi,

I am trying to access Azure Cosmos DB with the MongoDB API from Azure Logic Apps (both Standard and Consumption using built-in connectors). I understand that accounts using the MongoDB API are currently not supported. However, is there a way to perform CRUD operations in Logic Apps? If yes, the authentication type can be only Logic apps MI with which Role assignment, please?

Thanks,

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,332 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Khadeer Ali 2,770 Reputation points Microsoft Vendor
    2025-01-16T14:21:51.2133333+00:00

    @Shankar Naganathan ,

    Welcome to Microsoft Q&A Platform!

    Thanks for reaching out with your query.

    As you mentioned, Azure Logic Apps do not support direct integration with Azure Cosmos DB accounts using the MongoDB API. However, you could try achieving CRUD operations using Azure Functions as an intermediary.

    Here’s how you can achieve this:

    1. Create an Azure Function that connects to your Azure Cosmos DB for MongoDB account and performs the required CRUD operations (Create, Read, Update, Delete). Your Logic App can then call this function via an HTTP action.

    [Connect Azure Functions to Azure Cosmos DB using Visual Studio Code]

    1. You can use Managed Identity (MI) for your Logic App to authenticate and securely interact with the Azure Function. To grant the necessary permissions, assign the Cosmos DB Built-in Data Contributor role to the Logic App's managed identity. This role allows the Logic App to perform both read and write operations on the Cosmos DB account.

    By using this approach, you can successfully integrate your Logic App with Cosmos DB for MongoDB API through Azure Functions.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.