@Brian McAuley The WebSocket error 1006 typically indicates that the connection was closed abnormally, without a proper closing handshake. Here are a few things you might want to consider:
- Idle Timeout: Azure App Service has an idle timeout setting that might be closing your WebSocket connections prematurely. You can increase the idle timeout by setting the
WEBSITES_CONTAINER_IDLE_TIMEOUT
app setting to a higher value. The default is 20 minutes, but you can increase it up to 30 minutes (1800 seconds). - WebSocket Configuration: Ensure that WebSockets are properly enabled in your Azure App Service configuration. Sometimes, issues can arise if WebSockets are not correctly set up in the IIS features or if there are firewall rules blocking WebSocket traffic.
Network Latency and Load: Since the issue occurs more frequently under load or when scaling out, it might be related to network latency or resource contention. Monitoring your app’s performance and scaling settings might provide insights. Tools like Azure Application Insights can help you track these metrics.
SignalR Configuration: Check your SignalR configuration settings. Sometimes tweaking the transport settings or increasing the keep-alive interval can help maintain the connection.
Instance-Specific Issues: Since the problem occurs even with a single instance, it might be worth investigating if there’s something specific to that instance or its configuration. Restarting the instance or redeploying the app might help.