Auto-restart an unhealthy web app as an incident response strategy
  • 08 Jul 2022
  • 1 Minute to read
  • Contributors
  • Comments
  • Dark
    Light
  • PDF

Auto-restart an unhealthy web app as an incident response strategy

  • Comments
  • Dark
    Light
  • PDF

#ServerlessTips - Identity and Access Management
Author: Tidjani Belmansour Azure MVP

The “Auto-Heal” feature for Azure App Service Web apps recycles the worker process for our web application based on the settings we define, aiming to increase the reliability of our applications.
The “Auto-Heal” feature is useful when your application is experiencing slow request processing, memory leaks, and such lovely issues! 😊

For the sake of the demo, we’ll create a rule that will recycle the worker process if the application receives two occurrences of the Status Code 418 within 10 minutes.

Before I show you how to set it up, one thing worth mentioning here is that this is usually a temporary measure, not a permanent one! It is intended to keep our application available while we figure out the underlying cause and fix it.

Okay, now that we’re clear about this, let’s see how we configure it:
First, go to your web app instance, click on “diagnose and solve problems,” and search for “Auto-Heal”:

Picture1(11)

Next, turn on “Custom Auto-Heal rules,” select “Status codes” as a condition, and we will set our condition (2 occurrences of the status code 418 received within 10 minutes):

Picture2(9)

Then, we select “Recycle Process” as an action, and we hit the “Save” button:

Picture3(7)

And that’s it! Now, I can be confident that the appropriate remediation (i.e., recycling the worker process) will occur whenever the above condition occurs. Notice the “View All Sessions” button on the above screenshot. It will allow us to list all the times the Auto-Heal rule we defined was triggered.


Was this article helpful?