Enable app service healthcheck from az CLI
There’s a new healthcheck feature available, in preview as of 18-01-2020 (the link url includes ‘preview’, so it’ll probably break when the feature goes GA…)
When healthcheck is enabled:
- the platform sends requests, apparently every minute aprox, to monitor the specified health endpoint. As per the logs, the request seem to be sent every minute in a round robin, alternating all the VM instances behind the app service balancer.
- if Easy Auth is set for the app service, then for the configured endpoint it is disabled so it can be hit without authentication.
In the soon-to-be-broken documentation link they explain how to enable it through the Azure Resource Explorer. So, manually :S.
Enable healthcheck through az resource update
To set the endpoint /health to <APP_SERVICE_NAME> azure app service. If not sure about the resource Id of the web config file, just go to Azure Resource Explorer (as they explain here (soon to be broken)), inside your app service, config, web.
az login // if not logged already
az resource update --ids /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/Microsoft.Web/sites/<APP_SERVICE_NAME>/config/web --set properties.healthCheckPath="/health"