Forum Discussion
Anonymous
1 year agoNot applicable
How do properly authorize an application to access PowerBI data?
I'm trying to setup a Blazor application that embeds PowerBI reports into a page. I've been following the [Embed Power BI content with service principal and an application secret tutorial](https://l...
Poojara_D12
1 year agoSuper User
Hi Anonymous
The issue lies in permissions and service principal configuration. Here's what you need to do:
- Grant Admin Consent: Ensure your application has admin consent for the Power BI Service API permissions (e.g., Tenant.ReadWrite.All, Workspace.Read.All). Do this in Azure Portal for your app registration.
- Enable Service Principal for Power BI:In Power BI Admin Portal, ensure "Allow service principals to use Power BI APIs" is enabled.Assign your service principal as an admin or member of the target workspace in Power BI.
- Fix Token URL: Your tenantSpecificUrl should use the tenant ID of the user's organization, not your app's client ID. Replace "<MyClientId>" with the tenant ID of the org you're accessing. If multi-tenant, get the tenant ID dynamically from the user's login info.
- Enterprise App Authorization: Since the user adds the enterprise app, ensure they complete the Power BI role assignment process. Without it, your app cannot access their resources.
If you follow these steps, your app should get the token and access Power BI resources successfully.
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Please Subscribe my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS