I'm attempting to automate enabling the Health Check function on several hundred webapps.
For context, I've already successfully utilized az webapp update on the same test app in the same az context.
Though there are 2 additional fields to be configured, all examples I've found denote the below line of code as sufficient to enable health checks and set the path.
az webapp config set --resource-group "rg123" --name "123-WebApp-45678" --generic-configurations '{"healthCheckPath": "/910/Login?ReturnUrl=%2F"}'
I can clearly see "healthCheckPath": null, in the properties returned when I run the code, regardless of whether or not I've manually configured health checks in Azure Portal (which was done for testing purposes and later disabled).
When I run my original code:
az webapp config set --resource-group "rg123" --name "123-WebApp-45678" --generic-configurations '{"healthCheckPath": "/910/Login?ReturnUrl=%2F"}'
There is no change to the value for "healthCheckPath". In fact, this value does not seem to even reflect the actual state of the webapp.
I need a CLI solution (or PowerShell, if need be) to enable the Health Check feature and set the "healthCheckPath"
Is it my syntax? Am I operating on outdated info? Again, my other CLI interactions have succeeded with no change in Azure context.
Using
az webapp config setwill update the configuration settings of a web app as you already did.I've used the same command structure as you and was able to enable the health check feature with a given path as shown below.
I've visited the below resource web page, and it is also visible under the
site config property >> health check path.https://resources.azure.com/
Note: Upgrade the Az CLI version to the latest releases, also clear the cache with
az cache purgecommand and try executing the same command.Alternatively, you can use
Set-AzWebAppPowerShell command to update the site configuration of a web app.Refer Github for the PowerShell approach.