The UX for this is not friendly.
In the Portal open the App Service and choose Diagnose & solve problems and then Diagnostic Tools.
Click on Auto-Heal, enable it and add a rule:
Save the settings and break the app by making multiple calls for random numbers. Check the /healthz endpoint when both instances are failed and you’ll see they get replaced with new ones within a few minutes.
Here’s my output showing failed instances being replaced:
PS>curl https://rng-api-es2.azurewebsites.net/healthz
{"message":"Instance: f08cd58fd50f. Unhealthy"}
PS>curl https://rng-api-es2.azurewebsites.net/healthz
{"message":"Instance: 325b6b19d360. Unhealthy"}
PS>curl https://rng-api-es2.azurewebsites.net/healthz
Instance: c45fb7b5cd08. Ok
PS>curl https://rng-api-es2.azurewebsites.net/healthz
Instance: c45fb7b5cd08. Ok
PS>curl https://rng-api-es2.azurewebsites.net/healthz
Instance: a6a7a06dc0d1. Ok