Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I’ve been following the instructions on the Microsoft Power BI documentation to configure embedding with a Service Principal. However, when I run the example application from the Power BI Developer Samples GitHub repository, I encounter a 401 Unauthorized error.
When testing in Postman, I see the header X-PowerBI-Error-Info: ServicePrincipalIsNotAllowedByTenantAdminSwitch.
I’ve already enabled Service Principals to use APIs in the Power BI Service admin settings, but I’m still running into this issue. I couldn’t find anything on Google to resolve it.
Has anyone else encountered this problem or have any suggestions on what I might be missing?
Hi,@estuck1991 .I am glad to help you.
It looks like you have encountered a Service Body Authorization 401 error in Power BI embedded. This is generally possible that the service subject authorization has failed, tenant setup issues (not giving the necessary permissions) and the service subject may not have been assigned enough permissions to perform the required operations.
After discussing your issue with the rest of the team, I've come up with the following suggestions for you to troubleshoot.
The following issue covers most of the possible causes of the 401 error, so I hope you find it helpful.
URL:
Solved: Power BI REST API, HTTP 401 - Microsoft Fabric Community
2. After you have ensured that the permissions and tenant settings have been opened, please check whether your verification information is filled in correctly. (i.e. whether your Tenant ID and other information are mixed up)
Tenant ID:Green Area
Service principal ID:Red area
Service principal key:Pink area
Please double-check that your API permissions and other information configurations are set correctly (correct API permissions need to be configured)
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I have confirmed the tenant Id, client Id, and client secret. Also have set permission in the api for Power Bi Service as follows
Still getting unauthorized when trying to get embed information in appownsdata repo from the Power BI Developer Samples GitHub repository,
Hi,@estuck1991 .Thank you for your reply.
Please check that you have turned on the relevant permission settings in workspace, this is something that is easy to miss but it is very important.
You need to check this:
In the Power BI Admin Portal, navigate to
Tenant Settings > Developer Settings and enable 'Allow service subjects to use Power BI API'.
Add a security group: Add a security group containing service subjects to the workspace. In the Power BI portal, select the workspace, click Manage Access in the upper right corner, and add the security group as Menber or admin. Ensure that the service subject or the security group it is part of has at least Member or higher role permissions in the workspace.
I hope the following configuration article will help you with your check.
URL:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 18 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |
| User | Count |
|---|---|
| 46 | |
| 38 | |
| 36 | |
| 25 | |
| 20 |