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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
swamisharma
Frequent Visitor

Can we use web sockets in custom visual?

Hello All,
I am working on adding Autodesk APS viewer in our custom visual!
Which I am able to complete, but we have an another requirement to use Web Sockets in custom visual
I tried to test If I can use the web sockets in custom visual, and unfortunately I was not able to do that
I tested this `Quick WebSocket Test with JavaScript` from https://websocket.org/tools/websocket-echo-server/
and this was the result

swamisharma_0-1763723350331.png

So, is there any way we can use web sockets in custom visual, I tried to explore the documentation but I didnt found anything, Thanks!!

 

1 ACCEPTED SOLUTION
Ahmed-Elfeel
Solution Sage
Solution Sage

Hi @swamisharma,

The issue here is Power BI custom visuals run in a sandboxed environment with strict CSP rules and Your WebSocket connection to wss://echo.websocket.org/ is being blocked because:

  • The CSP directive only allows connections to specific domains Like (*.powerbi.com or *.microsoft.com)

You might need to Use a WebSocket service hosted on allowed domain or Proxy through an allowed endpoint

 

AlsoThis approach uses a middle-tier service to handle the WebSocket connection which then pushes the data to Power BI:

Microsoft Fabric websocket.png

 

Also here is Some Resources to help you solve this issue (I recommend it):

if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.
 
 

 

 

View solution in original post

4 REPLIES 4
Ahmed-Elfeel
Solution Sage
Solution Sage

Hi @swamisharma,

The issue here is Power BI custom visuals run in a sandboxed environment with strict CSP rules and Your WebSocket connection to wss://echo.websocket.org/ is being blocked because:

  • The CSP directive only allows connections to specific domains Like (*.powerbi.com or *.microsoft.com)

You might need to Use a WebSocket service hosted on allowed domain or Proxy through an allowed endpoint

 

AlsoThis approach uses a middle-tier service to handle the WebSocket connection which then pushes the data to Power BI:

Microsoft Fabric websocket.png

 

Also here is Some Resources to help you solve this issue (I recommend it):

if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.
 
 

 

 

Hello @Ahmed-Elfeel , Thanks for the references and insights

lbendlin
Super User
Super User

Are you planning to get that visual certified at some point?

Hey @lbendlin , Our visual is already on App Store, but not certified as we are doing HTTP calls

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors