# Blazor WebSocket WebApp behind APM not working...

**URL:** <https://community.f5.com/t/blazor-websocket-webapp-behind-apm-not-working/75524>\
**Category:** Technical Forums\
**Tags:** websocket, apm\
**Created:** [December 13, 2024, 6:44pm UTC](https://community.f5.com/t/blazor-websocket-webapp-behind-apm-not-working/75524 "2024-12-13T18:44:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![F5-Admin1](https://avatars.discourse-cdn.com/v4/letter/f/a88e57/32.png) [@F5-Admin1](https://community.f5.com/u/F5-Admin1)\
**Post date:** [December 13, 2024, 6:44pm UTC](https://community.f5.com/t/blazor-websocket-webapp-behind-apm-not-working/75524/1 "2024-12-13T18:44:01Z")

</div>

Dear community,

we a trying to host a new web-application using Websockets. I created a websocket profile - but we always get the following errors:

[2024-12-13T18:28:56.102Z] Information: Normalizing ‘\_blazor’ to ‘[https://remote-t.dfg.de/f5-w-687474703a2f2f73727767743238312e696e742e742e6466672e6465$$/f5-h-$$/\_blazor](https://remote-t.dfg.de/f5-w-687474703a2f2f73727767743238312e696e742e742e6466672e6465$$/f5-h-$$/%5C_blazor)’.  
blazor.server.js?F5CH=J:1 &nbsp;[2024-12-13T18:28:56.219Z] Warning: Failed to connect via WebSockets, using the Long Polling fallback transport. This may be due to a VPN or proxy blocking the connection. To troubleshoot this, visit [Host and deploy ASP.NET Core server-side Blazor apps | Microsoft Learn](https://aka.ms/blazor-server-using-fallback-long-polling).  
log @ blazor.server.js?F5CH=J:1  
blazor.server.js?F5CH=J:1 &nbsp;[2024-12-13T18:28:56.267Z] Error: The circuit failed to initialize.  
log @ blazor.server.js?F5CH=J:1  
blazor.server.js?F5CH=J:1 [2024-12-13T18:28:56.375Z] Information: Connection disconnected.  
blazor.server.js?F5CH=J:1 &nbsp;Uncaught (in promise) Error: Invocation canceled due to the underlying connection being closed.  
&nbsp; &nbsp; at Xt.\_connectionClosed (blazor.server.js?F5CH=J:1:62068)  
&nbsp; &nbsp; at Xt.connection.onclose (blazor.server.js?F5CH=J:1:51976)  
&nbsp; &nbsp; at pn.\_stopConnection (blazor.server.js?F5CH=J:1:91786)  
&nbsp; &nbsp; at features.reconnect.transport.onclose (blazor.server.js?F5CH=J:1:89471)  
&nbsp; &nbsp; at hn.\_raiseOnClose (blazor.server.js?F5CH=J:1:76756)  
&nbsp; &nbsp; at hn.stop (blazor.server.js?F5CH=J:1:76567)  
&nbsp; &nbsp; at async pn.\_stopInternal (blazor.server.js?F5CH=J:1:84144)  
&nbsp; &nbsp; at async pn.stop (blazor.server.js?F5CH=J:1:83975)  
&nbsp; &nbsp; at async Xt.stop (blazor.server.js?F5CH=J:1:55012)  
&nbsp; &nbsp; at async Ir.disconnect (blazor.server.js?F5CH=J:1:137836)

Without APM, the Website ist working fine.

What am I doing wrong?

I value and appreciate your time and energy and look forward to hearing from you.&nbsp; Thank you.

---

<div class="post-metadata">

**Author:** ![F5\_Design\_Engineer](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/f5_design_engineer/32/2479_2.png) [@F5\_Design\_Engineer](https://community.f5.com/u/F5_Design_Engineer)\
**Post date:** [December 17, 2024, 4:05am UTC](https://community.f5.com/t/blazor-websocket-webapp-behind-apm-not-working/75524/2 "2024-12-17T04:05:33Z")

</div>

Try following additional check

Shockingly the app.MapBlazorHub(blazorHubPath) is case sensitive. When the case doesnt match you get the same error described in the question. Please check for any case sensitive mismatch.

Check the possibility if the load-balancer doesn’t preserve the route to forward the requests to, and the requests from the app end up hitting random servers. Is there a way you can configure sticky sessions(Session persistence)? That should help.

There is definitely seems a load-balancer configuration issue. Can you confirm that you have [configured the site as specified in the SignalR docs](https://docs.microsoft.com/en-us/aspnet/core/signalr/publish-to-azure-web-app?view=aspnetcore-2.2#configure-the-app-in-azure-app-service)? Specifically, that “ARR Affinity” and “WebSockets” are both enabled as shown in the below screenshot.

Based on the error message, I would suggest to check that Web Sockets weren’t disabled for your app service.

It’s in General Settings under the Configuration blade.

If it’s enabled, then check for any firewall rules or NSGs that may have inadvertently applied to your app service.

 ![image_338586.jpg](https://d20hrnpixdzcsd.cloudfront.net/original/2X/c/c94530a22d61c64a4a28948e0d3ce7a2ff06359e.jpeg)

for f5 logs about **blazor.server.js** can you please run the following in bash mode and share the output

[root@f5-TestBox-01:Active:Standalone] ~ # cd /var/log  
[root@f5-TestBox-01:Active:Standalone] log # zcat&nbsp; &nbsp;\*.\*.gz | grep blazor.server.js

Please share the VIP config details from CLI output to help you further

> **[my blazor web site will load but when i go to the pages will not work -...](https://learn.microsoft.com/en-us/answers/questions/1696509/my-blazor-web-site-will-load-but-when-i-go-to-the)**
>
> My Blazor web site starts up but when go to a page is gives me an error.
> \[2024-06-14T15:20:27.225Z\] Information: Normalizing '\_blazor' to 'https://fieldmriservice.azurewebsites.net/\_blazor'.
> blazor.server.js:1 \[2024-06-14T15:20:27.370Z\] Information:…
