@Lowell Burns , 1/2
Thanks for posting this question. Apologies for any inconvenience with this issue and for a long post, I'm highlighting a few ways to identify the issue and make some considerations for your use-case.
Based on the information you provided, I understand that your Azure Web App is being recycled at random times, which is causing problems for your web socket server.
Just to clarify, what App Service Plan (ASP) are you leveraging?
I understand 5/7 WebApps are getting restarted, are all those Windows or Linux Apps?
- One possible reason for the issue could be that the App Service Plan (ASP) is running out of resources, such as memory or CPU. You can check the resource usage of your Web App by going to the "Metrics" section in the Azure portal and selecting the appropriate metrics, such as CPU usage or memory usage. If you find that the resource usage is consistently high. (If feasible), I understand you’re looking to understand the cause of the recycle problem and plan to handle this in socket, the following would help isolate the issue. you can consider moving the Web Apps to separate ASP or scaling up the existing App Service Plan to a higher tier.
- If the
Always On
setting is off, please enable it from Azure Portal –---Your WebApp > Configuration blade (> General settings). - You may leverage App Service diagnostics from Azure Portal> Navigate to your App Service app in the Azure Portal. (screenshot below) ---- In the left navigation, click on
Diagnose and solve problems
- Review - “Configuration and Management" and “Availability and Performance” options.
I hope this information helps point you in the right direction. If you have any further questions or concerns, please let us know.