Search code examples
azureazure-virtual-machineazure-monitoringazure-load-balancer

How do I set up healthprobe for a web application running on an Azure virtual machine?


State of the application:

  • A single virtual machine which runs an apache server.
  • Application exposed via the virtual machine's public IP (not behind a loadbalancer)

I have an healthprobe endpoint running that needs probed every few seconds to see if the app is up, and trigger an alert in case it is not.

What are my options? I want to get the healthprobe up and running first, before I move to a virtual machine scale set and a load balancer.


Solution

  • You need something like a watchdog that calls the health endpoint at a given interval. In Azure you can use an availability test. You can then create alerts based on this availability and optionally create dashboards that show the status over a given period.

    As a bonus you might integrate the application insights resource in your web app to get detailed monitoring. See the docs