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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
powerbi_jenhen
Resolver II
Resolver II

Admin API's and Service Principal Authentication = 401 Unauthorized

Hi,

 

I have registered an azure app for my service principal, added it to an Azure Security group and added this group to my admin and non-admin api tenant developer settings. The app has been granted the correct API permissions for Power BI Service without any admin consent requirements (see below). I have added the group with admin permissions to all tenant workspaces. Via Powershell I can successfully authenticate using the service principal for non-admin api calls but everytime I attempt to call admin api calls, like the below, I receive "401 Unauthorized"?? Any help appreciated.

 

Invoke-PowerBIRestMethod -Url 'admin/groups?$top=100' -Method Get | ConvertFrom-Json

 

powerbi_jenhen_0-1670534111425.png

 

1 ACCEPTED SOLUTION
powerbi_jenhen
Resolver II
Resolver II

I figured this out, my azure app permissions of type "Application" had "Admin consent", as described in the below article, this must be remove:

 

Enable service principal authentication for read-only admin APIs - Power BI | Microsoft Learn

View solution in original post

3 REPLIES 3
powerbi_jenhen
Resolver II
Resolver II

I figured this out, my azure app permissions of type "Application" had "Admin consent", as described in the below article, this must be remove:

 

Enable service principal authentication for read-only admin APIs - Power BI | Microsoft Learn

powerbi_jenhen
Resolver II
Resolver II

Hi,

 

Thanks for your reply. Yes, this option has been enabled for my security group but I still get the 401?

 

Thanks.

Anonymous
Not applicable

Hi @powerbi_jenhen ,

According to the error code, it seems that you didn't get the proper permission to access Admin REST API. Please check if you enable the option Allow service principals to use read-only Power BI admin APIs under Admin API settings in Admin portal.

Enable service principal authentication for read-only admin APIs

yingyinr_0-1670570486538.png

Best Regards

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.