March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I cloned the demo repository at: https://github.com/microsoft/powerbi-client-react
and have not made any code changes.
I run "npm run demo" to start the app, and then after clicking "embed report" I am hit with this error:
Thank you for your reply, I see I can follow the steps to change it to use my own report.
The demo repo is setup to embed a demo report from Microsoft. Do you know if there is any workaround to authenticate with this report and avoid the error?
Hi, @karlrez
You seem to be experiencing the 403 Forbidden error and CORS policy issue. The 403 error usually indicates a permissions issue, and you need to make sure that the API permissions are set correctly in Azure Active Directory and that you have the appropriate permissions to access the Power BI REST APIs. Also make sure you're using the correct token type. For embedded reports, you should use models. TokenType.Aad if you are embedding for your organization. You can check the following links:
Solved: 403 forbidden error while trying to call power bi ... - Microsoft Fabric Community
Solved: Re: Embed report using react-powerbi-client ends w... - Microsoft Fabric Community
The CORS policy is wrong because the server does not allow requests from your local development environment. You'll need to check that the server hosting the Power BI report has the correct CORS header set up. This typically involves setting the Access-Control-Allow-Origin header to allow requests from your development environment. For local development, you can use a CORS proxy or browser extension to temporarily bypass CORS restrictions. You can check the following links:
What Is CORS Policy Error in React App and How To Get Rid of It? - Upmostly
Understanding CORS Policy Errors and Their Resolutions for React Developers – devgem.io - devgem.io
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |