Hi @Chengxuan He we are sorry to hear you're facing this issue. Is this a windows or Linux web app?
Here are 3 things you can do to troubleshoot this issue:
- Ensure that WebSockets are enabled in your Azure App Service. If your app is hosted on Linux, WebSockets are always enabled, and thus, you won’t find an option to turn them on or off. However, if its Windows based, you'll find the option present in the App's settings, Configuration tab.
- Look into your CORS settings to ensure they are correctly configured to allow connections from your Azure Static Web App domain. This includes ensuring that the
Access-Control-Allow-Origin
header is set to allow your frontend domain. - Lastly,if your application relies on stateful connections, you might need to disable ARR Affinity in the General settings tab of your App Service. ARR Affinity can sometimes interfere with WebSocket connections
Hope that helps. Please let us know if you have further questions.
-Grace