Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I’m working on integrating ChatGPT or Google Gemini into Power BI using a custom visual to enable interactive AI responses directly from the report, based on the dataset contents.
Everything works fine when I test the API in Postman, but Power BI blocks the API call from the custom visual due to security restrictions, most likely related to Content Security Policy (CSP) or cross-origin (CORS) issues.
Built a custom visual in Power BI using React and TypeScript
Integrated OpenAI/Gemini API logic inside the visual
Created a proxy API server to forward the API requests
Used tunneling tools like:
localtunnel
ngrok
Cloudflare Tunnel
How can I successfully connect Power BI custom visual to OpenAI/Gemini API through a proxy or tunnel?
Is there a recommended tunneling or reverse proxy approach that works with Power BI visuals?
Any guidance or step-by-step solution would be greatly appreciated!
Thanks!
Solved! Go to Solution.
Hi @jesikamaurya ,
Thanks for reaching out to the Microsoft fabric community forum.
Power BI imposes several restrictions on custom visuals by running them in a sandboxed environment with the least amount of privilege. As a result, any content hosted inside the visual that requires elevated permissions is unlikely to function correctly. This sandboxing also strips away the domain context from custom visuals, preventing them from impersonating powerbi.com. Consequently, attempting to access services or embed content from sites that enforce CORS restrictions will fail within the visual. Since CORS policies are enforced by the target server, they cannot be overridden from the client side, including within the visual itself.
If your endpoint enforces a CORS policy, it won’t be accessible from a Power BI custom visual. Microsoft sandbox custom visuals, which results in requests being sent with a null origin. Even if your code is correct, the target server will block the request due to this null origin unless explicitly allowed, making direct API calls from the visual unsuccessful.
If the ability to call third-party services is important to your use case, we recommend submitting a suggestion in the Power BI Ideas forum.
Fabric Ideas - Microsoft Fabric Community
This platform is actively monitored by the product team, and highly supported posts are often implemented to Power BI.
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you
Hi @jesikamaurya ,
Could you please confirm if you've submitted this as an idea in the Ideas Forum? If so, sharing the link here would be helpful for other community members who may have similar feedback.
If we don’t hear back, we’ll go ahead and close this thread. For any further discussions or questions, please start a new thread in the Microsoft Fabric Community Forum we’ll be happy to assist.
Thank you for being part of the Microsoft Fabric Community.
Hi @jesikamaurya
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If our responses has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @jesikamaurya ,
Thanks for reaching out to the Microsoft fabric community forum.
Power BI imposes several restrictions on custom visuals by running them in a sandboxed environment with the least amount of privilege. As a result, any content hosted inside the visual that requires elevated permissions is unlikely to function correctly. This sandboxing also strips away the domain context from custom visuals, preventing them from impersonating powerbi.com. Consequently, attempting to access services or embed content from sites that enforce CORS restrictions will fail within the visual. Since CORS policies are enforced by the target server, they cannot be overridden from the client side, including within the visual itself.
If your endpoint enforces a CORS policy, it won’t be accessible from a Power BI custom visual. Microsoft sandbox custom visuals, which results in requests being sent with a null origin. Even if your code is correct, the target server will block the request due to this null origin unless explicitly allowed, making direct API calls from the visual unsuccessful.
If the ability to call third-party services is important to your use case, we recommend submitting a suggestion in the Power BI Ideas forum.
Fabric Ideas - Microsoft Fabric Community
This platform is actively monitored by the product team, and highly supported posts are often implemented to Power BI.
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
4 | |
2 | |
2 |
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
2 |