question

DeepakBansal-0367 avatar image
0 Votes"
DeepakBansal-0367 asked PuneetGupta-4162 edited

What is best way to implement autoheal for azure linux based web app services?

I want to implement azure auto healing for our Linux based web app services. As there does not seems to be this capability available for Linux based web app services, could you please share the recommended way to implement? Sample scenario- my web app services is running on multiple instances and one of the instances started taking longer to respond or throwing 5xx errors, I need to recycle the app pool of respective service instance automatically.

azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SnehaAgrawal-MSFT avatar image
0 Votes"
SnehaAgrawal-MSFT answered DeepakBansal-0367 commented

Thanks for asking question! You may try setting up a Health check page in the application and then use the newly introduced Diagnostic Settings feature (which basically pushes telemetry to Azure Monitor) to send HTTPLogs to Azure Monitor. In Azure Monitor an alert rule can be setup that triggers a Restart API if a certain threshold has been crossed for HTTP failures for that healthcheck endpoint.
Please note that Azure Monitor Integration is in Preview


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks Sneha. we have our own authentication mechanism and we don't want to create anonymous access for health check page. Is it possible to achieve it via alert action? like if we setup an alert for 5xx error, and as part of alert action if it can find and recycle the respective app pool?

0 Votes 0 ·
SnehaAgrawal-MSFT avatar image
0 Votes"
SnehaAgrawal-MSFT answered

Thanks for reply! You may try configuring Auto heal by:

  1. Using an API and use Application Insight SDK to monitor your application and then perform restart application based on your
    requirement. Please check following URL’s for your reference purpose:

    https://docs.microsoft.com/en-us/azure/azure-monitor/app/api-custom-events-metrics

    https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core

  2. Using Azure function and perform ping test and then restart the server on a non HTTP 200 response.


To add to this, I have posted your requirement related to Autoheal feature for Linux servers internally and our Product Group knows about this. Also, I would request you to share your feedback for the same on below link which is actively monitored by Product Group.





5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PuneetGupta-4162 avatar image
0 Votes"
PuneetGupta-4162 answered PuneetGupta-4162 edited
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.