Thanks for reaching here! If you have enabled Health Check for your Azure App Service but the metric is not being collected, there could be a few reasons for this.
Here are some steps you can take to troubleshoot the issue:
- Check if the Health Check feature is enabled for your App Service. You can do this by browsing to the Azure portal and selecting your App Service app. Under Monitoring, select Health check. If the feature is not enabled, select Enable and provide a valid URL path on your application, such as /health or /api/health. Select Save.
- Check if the Health Check URL is correct. Make sure that the URL you provided for the Health Check is correct and returns a status code between 200-299 (inclusive). You can test this by browsing to the URL in a web browser or using a tool like Postman.
- Check if the Health Check is configured correctly. In addition to configuring the Health Check options, you can also configure the following app settings:
- WEBSITE_HEALTHCHECK_MAXPINGFAILURES: The required number of failed requests for an instance to be deemed unhealthy and removed from the load balancer. For example, when set to 2, your instances will be removed after 2 failed pings. (Default value is 10)
- WEBSITE_HEALTHCHECK_IDLETIMEOUT: The amount of time (in seconds) that an instance must be idle before it is removed from the load balancer. (Default value is 120)
- WEBSITE_HEALTHCHECK_PATH: The URL path that the Health Check feature will use to ping your application. (Default value is /)
- WEBSITE_HEALTHCHECK_STATUSCODES: The status codes that the Health Check feature will consider healthy. (Default value is 200-399)
- Check if the Health Check is being blocked by a firewall. If your application is behind a firewall, make sure that the Health Check URL is allowed through the firewall.