Health Check
Set the key HealthCheckIssue=true and the health check path to /HealthCheck to induce a 500 erorr for the health check
Set the key HealthCheckIssue=numberOfFailures and the health check path to /HealthCheck to induce a x number of 500 erorr for the health check and than answer only once with a 200
Enable Health check feature for a page that doesn't exists "/healthCheck404"
We can see the server isn't healthy
The instance will be considered healthy only if the status code is between 200-299
App Service Health Check DocumentationWe can enabled the rewrite rule from web.config to always answer with a 200 if the User Agent is Health Check