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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm making a React Based custom visual that is inteded to work with my connector, I have a table with URLs where each URL points to an image, you can request that image but the request needs to contain an authorization header, something like this in my React component:
But for my specific case (where the request needs to be authenticated, I'm getting an error):
Hi @ECorona,
The CORS error you're seeing isn't from Power BI blocking the request - it's the server (wikimedia in your example) rejecting the Authorization header in the preflight request. The server needs to explicitly allow the Authorization header in its CORS configuration.
For your custom visual scenario, here are some options which I havent implemented by my self but might work:
Backend Proxy: The most common solution is to route requests through a backend service you control. Your visual calls your backend, which then makes the authenticated request to the image server.
Power BI Service Account: If your images are in a service that Power BI can connect to, consider using Power BI's built-in authentication mechanisms through your connector rather than client-side fetch.
Server CORS Configuration: If you control the image server, ensure it returns these headers:
Access-Control-Allow-Origin: * Access-Control-Allow-Headers: Authorization
Since you mentioned having a custom connector, the cleanest approach would be to fetch the images through Power BI's data pipeline (authenticated via the connector) and embed them as base64 data URIs in your dataset, rather than making client-side requests from the visual. Or if you want to use Fabric items you can also fetch the data with a pipeline which contains the HTTP request, store the images in OneLake at take them from there. But still the CORS policy is applied.
Best regards!
PS: If you find this post helpful consider leaving kudos or mark it as solution
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 2 | |
| 1 | |
| 1 |