Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an Azure CLI command for getting Health Check status from Function App?

I've created a Function App, and everything seems to be running fine. In the Azure Portal, Function App Overview I can see that the Health Check is "100.00% (Healthy 2 / Degraded 0)", and on the Health Check page of the Function App I can see that it's enabled and the endpoint is "api/health".

Is there a way to get the "100% (Healthy 2 / Degraded 0)" through an Azure CLI command. It looks like az functionapp list only gives me the siteConfig.healthCheckPath value and that's not what I need.

enter image description here

like image 936
Simon K Avatar asked Oct 22 '25 15:10

Simon K


1 Answers

You can fetch the values of Health Check Status metric by using the Azure CLI command az monitor metrics list as described here https://learn.microsoft.com/en-us/cli/azure/monitor/metrics?view=azure-cli-latest#az-monitor-metrics-list.

Example: az monitor metrics list --resource myresource --resource-group myresourcegroup --resource-type "Microsoft.Web/sites" --metric "HealthCheckStatus" --interval 5m

Note that the --interval property is important as health checks do not support the default 1m interval used by az monitor metrics list

like image 119
michn Avatar answered Oct 25 '25 14:10

michn