Connect Azure CosmosDB for MongoDB API from Power BI

EbenezarjayabaskarJoel-8243 20 Reputation points
2024-08-19T05:32:10.69+00:00

Connect Azure CosmosDB for MongoDB API from Power BI:

We have Serverless Azure CosmosDB for MongoDB API, we would like to connect it from Power BI for reporting.

We don't want any third party ODBC connector or tools here.

What does Microsoft Provide for the same to connect MongoDB from Power BI?

What ways we can connect it? Like we can try Azure Functions?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,855 questions
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,604 questions
{count} votes

Accepted answer
  1. Vinodh247 16,826 Reputation points
    2024-08-19T08:14:35.2833333+00:00

    Hi EbenezarjayabaskarJoel-8243,

    Thanks for reaching out to Microsoft Q&A.

    To connect Azure Cosmos DB for MongoDB API to Power BI without using 3rd party ODBC connectors or tools, Microsoft provides some options, pls go trhough and let me know if this will suit your needs:

    Connection Methods

    1. Azure Synapse Link:
      • This method allows you to build Power BI reports with minimal impact on your transactional workloads. By enabling Azure Synapse Link, you can create a direct connection to your Cosmos DB data without requiring ETL processes. This is particularly useful for real-time reporting and analytics.
    2. Power BI Connector for Azure Cosmos DB:
      • You can use the built-in cosmosdb connector in PowerBI Desktop. This option is available in import mode, which means you will be importing data into Power BI. To connect:
      • Open Power BI Desktop --> Select Get Data > Azure > cosmosdb(beta).
      • Enter the cosmosDB account endpoint URL and your account key (preferably the read-only key for security).
      • Once connected, you can navigate through your databases and collections to select and load the data you need.
    3. Direct Query Mode:
      • If you prefer to work with live data, you can use DirectQuery mode when connecting through Azure Synapse Link. This allows you to create dashboards and reports based on real-time data from your Azure Cosmos DB account without needing to import data into Power BI.
    4. Using Azure Functions:
      • Although not a direct connection method, you can leverage Azure Functions to create a REST API that interacts with your cosmosdb. This api can then be called from Power BI using the Web connector, allowing you to fetch data dynamically. This approach requires additional setup but can be beneficial for specific use cases where custom data processing is needed.

    Also, pls beware of the limitations of the api for mongodb, as it may not support all MongoDB features. It's essential to test your queries and data interactions to ensure compatibility

    Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.