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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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