how to call power bi rest apis from fabric data pipelines.
introduction.
Inspired by Gerhard Brueckl’s article on Querying Power BI REST API using Fabric Spark SQL, I thought I’d provide a walkthrough on how to call Power BI REST APIs from Fabric Data Pipelines. Especially the way of authenticating has changed since Data Pipelines and Power BI both live in Fabric. Before, we were able to leverage Azure Data Factory’s Managed Identity to access a Power BI Workspace, but now things work differently. With Fabric’s equivalent Data Pipelines, you specify the authentication method already in the connection itself.
Also, at the time of writing this post, Fabric is still in preview, meaning things can and will change. If the suggested approach does not work on your end or you have a better practice, please let us know in the comments below.
[Edit 2023-11-17 – literally a day after I released this blog post, Fabric was announced to become GA. They also pushed the Fabric API suite to Public Preview. If you are interested in learning how to call fabric rest apis from fabric data pipelines, just click here]
[Edit 2024-04-15 – last week a new Fabric pipeline activity was released into preview, which triggers a Power BI semantic model refresh. Its capabilities seem still be limited to for the refresh of the whole semantic model, but there might be other operations available from this activity in the future]
prerequisites.
1. A Fabric capacity and workspace
2. A Data pipeline
1. What’s the goal?
The goal is to be able to call Power BI REST APIs from a Fabric Data Pipeline. As seen in the example below, we called the Get Group API returning a workspace.
2. Set up a new connection
At first, we need to set up a new web V2 connection that will be used to call the API. For this, click on the settings icon in the top right and then Manage connections and gateways.
Next, click on + New
Now, select the Cloud option, provide a name and fill in the other fields according to the picture. When you are done, press the Create button.