App Service Health check automation

Ondrej Krč-Jediný 21 Reputation points
2021-01-15T10:28:25.4+00:00

Is there any way how to automate App Service -> Monitoring -> Health check functionality? I'd like to set it up automatically for my App Service that is being deployed via ARM template, but any of these options would be OK to enable Health check and set Health check path:

  • ARM template
  • Azure PowerShell
  • Azure CLI
  • Azure REST API

I'm not able to find the functionality in any of them. There is a healthCheckPath property in App Service's SiteConfig, but it returns empty value even for App Services where I turned on and configured Health check functionality via Azure Portal.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,963 questions
{count} votes

Accepted answer
  1. Andriy Bilous 10,981 Reputation points MVP
    2021-01-15T21:21:01.41+00:00

    Hello @Ondrej Krč-Jediný

    ARM Templates support Health Check feature in WebApp

    • To enable the feature with ARM templates, set the healthcheckpath property of the Microsoft.Web/sites resource to the health check path on your site, for example: "/api/health/". To disable the feature, set the property back to the empty string, "".

    https://learn.microsoft.com/en-us/azure/azure-monitor/platform/autoscale-get-started#route-traffic-to-healthy-instances-app-service

    With AZ CLI you can use --generic-configurations option and specify for example healthCheckPath=/api/health/ there
    az webapp config set -g MyResourceGroup -n MyUniqueApp --generic-configurations "{\"healthCheckPath\": \"/api/health/\"}"

    https://learn.microsoft.com/en-us/cli/azure/webapp/config?view=azure-cli-latest#az_webapp_config_set-optional-parameters

    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful