Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SvenApl
New Member

Cannot list Dataflows as Admin via Service Principal

Hi everyone,

 

I encountered a very weird situation today. My goal is to get a list of all dataflows in my tenant via the API (GetDataflowsAsAdmin) using a service principal / azure App.

 

For this I

  1. registered an app in azure
  2. did not give any permissions (especially non that need admin consent)
  3. added said app/service principal to an Entra-ID-Group which is allowed to call the read-only admin API ("Service principals can access read-only admin APIs"). This is set in the PowerBI admin portal

Now, using python, I wanted to get the list of all dataflows but I get an 401 Unauhtorized and I am not sure why, since a lot of other admin APIs do work.

 

E.g. I can query the following and get results back:

But 

does not work (unauhtorized).
 
Does my service principal need additional permission just for dataflows? I could not get any information from the docs...so perhaps someone here knows more.
 
FYI: I first get an access token via msal for
 
Thank you,
Sven
1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @SvenApl,

Have you take a look at the official document about how to use service principal with power bi rest api and its usage limitations? If not, I'd like to suggest you check them at first.

Embed Power BI content in an embedded analytics application with service principal and an applicatio...

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
SvenApl
New Member

Thank you for your answer! Seems like I missed that article as I didn't think my problem had something to do with embedding.

It would be nice if there were some tags or markers that show which API is supported for service principals and which are not.

 

In this case it seems that I will have to use my own account.

 

Best,

Sven

v-shex-msft
Community Support
Community Support

HI @SvenApl,

Have you take a look at the official document about how to use service principal with power bi rest api and its usage limitations? If not, I'd like to suggest you check them at first.

Embed Power BI content in an embedded analytics application with service principal and an applicatio...

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.