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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Embedding Service principle AppOwnsData 401 ServicePrincipalIsNotAllowedByTenantAdminSwitch

My set-up before starting work with Power BI Embedded was an Azure AD with a group that had a Workspace in the Power BI Service (app.powerbi.com) containing reports. 

To be able to embedd reports I followed the steps here: https://app.powerbi.com/embedsetup/appownsdata

 

I've configured it to use Service Principal but when i try to read the report I get a 401 Unathourized back. In fiddler i see X-PowerBI-Error-Info: ServicePrincipalIsNotAllowedByTenantAdminSwitch but I can't find anything on google that helps me. I have allowed Service Principals to use API:s in the admin settings in Power BI Service. Anyone else experiencing this? I must've missed something basic since I can't find anyone with this issue

 

However when I follow the steps here https://docs.microsoft.com/en-us/power-bi/developer/embed-service-principal

on step 2 I tried creating a new AzureADGroup but when that didn't work i found that add a group user (Service principal) to the power bi workspace was the fix. Why this, what did I do wrong? 

https://docs.microsoft.com/en-us/rest/api/power-bi/groups/addgroupuser

 

6 REPLIES 6
Anonymous
Not applicable

You need to add your service principal in step 5

Anonymous
Not applicable

I had done that, didn't make a difference. But I left that behind now and stuck with the powershell way of doing this which worked

Could you please share how did you fix the issue, i'm getting the same response back from the power bi apis "ServicePrincipalIsNotAllowedByTenantAdminSwitch"
I added the service principal as an admin to my workspace but it's still not working

Anonymous
Not applicable

I'm sorry but I don't remember, I think it was granting the User (service principal) permissions to the workspace https://docs.microsoft.com/en-us/rest/api/power-bi/groups/addgroupuser

I was able to resolve it by going to Power BI Admin portal (accessible from settings cog on https://app.powerbi.com/home), selecting Tenant Settings, and then toggling the Allow service principals to access Power BI APIs setting to enabled

 

See the Getting started with service principal section in this article https://powerbi.microsoft.com/en-us/blog/use-power-bi-api-with-service-principal-preview/

 

in my case - I lost 5 hours to cope with that.... I made some stupid but obvious change...

turn off service principal api in power bi admin, then turn on again.

THANKS MICROSOFT FOR SUPER CLEAR AND INTUITIVE SYSTEM....

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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