Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
jesikamaurya
Frequent Visitor

Query: Power BI Custom Visual API Block – GPT/Gemini Integration Issue

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.

 

I’ve Tried So Far 

  1. Built a custom visual in Power BI using React and TypeScript

  2. Integrated OpenAI/Gemini API logic inside the visual

  3. Created a proxy API server to forward the API requests

  4. Used tunneling tools like:

    • Localtunnel

    • ngrok

    • Cloudflare Tunnel

But unfortunately, the API calls are still being blocked when the custom visual is rendered inside Power BI Desktop

 

I Need Help With

  • 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 other approaches to solve the problem.

 

Please share your thoughts.

Any guidance or step-by-step solution would be greatly appreciated!


Thanks!

2 REPLIES 2
querixa
Helper IV
Helper IV

I've faced similar CSP/CORS issues when trying to integrate external APIs directly into Power BI visuals. The security restrictions are quite strict, and even proxy servers often get blocked because Power BI treats them as external origins.

One approach that worked for me was embedding the AI logic differently, instead of calling APIs from the visual, I pre-processed insights during data refresh. If you're looking for a ready-made solution that handles these integration challenges, you might find PowerMind interesting, it's designed specifically to embed AI assistants inside Power BI dashboards without running into these blocking issues.

Check out our LinkedIn demo post for a quick look at how it works in practice.

https://www.linkedin.com/posts/querixa_powerbi-microsoftfabric-dataanalytics-activity-74394511856963... 

 

https://www.youtube.com/watch?v=JPscIa7SNZw  

Mauro89
Super User
Super User

Hi @jesikamaurya,

 

long time no answer to your question. Maybe I can help you here.

There is a new feature for Fabric/Power BI called User Data Function.

Check out the blog here: Announcing Fabric User Data Functions (Preview) | Microsoft Fabric Blog | Microsoft Fabric

 

I already saw demos from Microsoft where they put an API call in a UDF to call a LLM endpoint. This function was then provisioned to Power BI for calling and taking the input data from the report.

 

Best regards!

PS: If you find this post helpful consider leaving kudos or mark it as solution

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Solution Authors