Power BI REST API — configuration

Michal Molka
3 min readSep 13, 2024

--

Let’s assume you plan to create an external app. You want to use it to cooperate with Power BI. This app is written in C#, Python or another programming language. The easiest and most versatile way is to use a REST API. Today, I will show you how to configure Azure and Power BI to facilitate REST API usage.

The first step is creating a Service Principal and adding a Security Group.

After the App Registration is created. Copy an Application (client) ID and Directory (tenant) ID into your application code. We will use them later.

We must make two additional steps:

  • generate a secret,
  • add an API permission.

After the secret is created. Copy it to your application as well.

When it comes to API permission. Add two possible options for Power BI.

  • Tenant.Read.All,
  • Tenant.ReadWrite.All

Then Grant admin consent for your tenant.

Our Service Principal is ready. Now we need to create the security group and assign the service principal as the group member.

As you noticed. The fabric-rest-api service principal is a member of a fabric-rest-api-security-group security group.

Switch over to a Power BI admin portal. In the Tenant settings section, look for a Service principals can use Fabric APIs position. Then add the security group.

In the same section. Add the security group in a Service principals can access read-only admin APIs position.

In the last step you need to add access to chosen workspaces.

And here we are. Everything is set up. Now you can use the REST API from the external application.

--

--

Michal Molka

Architect | Azure | Power BI | Fabric | Power Platform | Infrastructure | Security | M365