borys86
borys86

Reputation: 1984

Data refresh of Cosmos DB in PowerBI portal

Is there a simple solution to automatically refresh data in a report produced using Cosmos DB in Power BI after the report is published?

Right now I can use Power BI Desktop to import data from Power BI, transform it and make a report. Then I can publish it. The challenge is that data in a Cosmos DB instance updated quite regularly and I want to present it to others through app.powerbi.com without a need to open the initial file in Power BI Desktop and click refresh and publish just so others can see updated data.

The only solution I found so far is https://github.com/Azure/azure-cosmosdb-spark/wiki/Configuring-Power-BI-Direct-Query-to-Azure-Cosmos-DB-via-Apache-Spark-(HDI) but this is not a simple solution.

Upvotes: 2

Views: 2988

Answers (1)

Alberto Vega
Alberto Vega

Reputation: 542

There are a couple options for you to explore:

  • Easiest one is the scheduled refresh for Power BI, you could schedule a daily refresh or as often as your need to. Just please be mindful that it will be querying your Cosmos DB, so as you do refresh more often it might incur in more Request Unit (RU) charges. You can learn more Power BI Scheduled Refresh documentation

  • This one is a little more involved. You could use Power BI refresh API and Azure Cosmos DB Change Feed. To learn more about how they work and see some how to guides please read these docs Data Refresh API and Azure Cosmos DB Change Feed.

to expand a little more on the second option, Azure Cosmos DB Change Feed will allow you to listen to changes or updates in your database and trigger the API call to Power BI refresh every time there is a change. You could use a logic app or an azure function to trigger the API call, You just will need to evaluate which one works better for you.

Upvotes: 5

Related Questions