question

OndrejKrJedin-4270 avatar image
0 Votes"
OndrejKrJedin-4270 asked AndriyBilous edited

App Service Health check automation

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-webapps
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @OndrejKrJedin-4270

Are you wanting to enable the Health check feature automatically instead of using the Azure portal?

0 Votes 0 ·

1 Answer

AndriyBilous avatar image
2 Votes"
AndriyBilous answered AndriyBilous edited

Hello @OndrejKrJedin-4270

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://docs.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://docs.microsoft.com/en-us/cli/azure/webapp/config?view=azure-cli-latest#az_webapp_config_set-optional-parameters

· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I tried this and got invalid syntax error. It should wrap quotes with \

az webapp config set -g MyResourceGroup -n MyUniqueApp --generic-configurations "{\"healthCheckPath\": \"/api/health/\"}"

Hope this helps others :)

4 Votes 4 ·

How do you set the Load Balancing time using an ARM template?

azure-portal-navigation-health-check.png


2 Votes 2 ·

One extra vote for the question how to set load balancing time through arm... :)

2 Votes 2 ·

You can set the load balancing time by the application configuration attribute "WEBSITE_HEALTHCHECK_MAXPINGFAILURES".

{
"name": "WEBSITE_HEALTHCHECK_MAXPINGFAILURES",
"value": "5",
"slotSetting": false
}

2 Votes 2 ·

Wow, classic app services! Do they get extra points for being as inconsistent as possible?

0 Votes 0 ·
73485667 avatar image 73485667 MatthewNelson-3347 ·

I have the same question. How do we set load balancing time here ..

+Following

0 Votes 0 ·