Forum Discussion
Creating a Report from PowerBI API
Hello -
I thought this would be a common request, but can't seem to find much in the forums 🙂 We're trying to create an Operational Health Dashboard (in PowerBI) for our PBI reporting environment. End goal is to show all our workspaces, reports, datasets, and datasource connections, and a summary of any failures in down-stream dataset/datasource failures thus showing a cascading impact to reports.
After researching the topic, it appears the only way to do this is by hitting the PBI API (example below). But api.powerbi.com doesn't appear to support integrated authentication when we specify the API as a "web" datasource. What are we missing? Seems weird that Microsoft doesn't support their own OAuth implementation.
So do we need to manually include the bearer token in the header of the the "web" datasource connection? If so, any guidence on how to do this? I'm really surprised this isn't a more common request, so I'm wondering of we're going down an atypical route.
https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshes?$top=1
Thanks,
2 Replies
- GilbertQSuper UserHi there
This certainly can be done when I have used the API with PowerShell
You have to always first authenticate which will then store the authenticated token as part of the call to Power BI.
Here is a blog post explaining how to get this done
https://powerbi.microsoft.com/en-us/blog/working-with-powershell-in-power-bi/- AnonymousNot applicable
Thanks, and that is the route we're already going down.
My question to you is: Is there a way to fully automated that process? Meaning, is there a way to do all this through a scheduled data refresh that authenticates the powershell commands, download the json, and loads the json data into a dataset fully automated without any user interation?
That is the end-goal of this project for us.
Thanks!