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:

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"