Power BI Admin API [2/3]

In part one of this series we figured out how to connect to the Power BI Admin APIs with a service principal in order to automate and schedule script executions. While Power BI offers build in data lineage views and performance metrics, it will not give you a holistic overview. Microsoft announced new options using Azure Log Analytics or Azure Purview, but this will require additional Azure subscriptions and might not give you all the required information. A great alternative is to use the Power BI REST APIs with a service principal and schedule the calls without requiring a manual log-in. In the following post you will learn how to implement a connection to the Admin APIs with PowerShell. Please note that the Power BI APIs are continously improved just recently there was a new scanner API released, which is currently in preview. 

Related work

  • A great ressource for the developing these scripts are the blog posts and Github repository from Brett Powell's Data & Analytics Blog.
  • Miguel Escobar created a custom connector which can work with the client secret authentification, find out more here.
  • Steven Parkers (BI Elite) shows in his video series how to connect to the Power BI Admin APIs directly from a Power BI Dataset using access tokens. While no PowerShell is needed for this approach, a major drawback of this approach is that the keys are hard coded inside the Power Query and the only way of historize the data are incremental refreshes.