Implementing health checks
The hosting platform needs to know if the service started successfully and is available to serve requests. While the service is running, the hosting platform continuously checks the service to see if it is running or broken and needs to be restarted. This is what health checks are for.
With Kubernetes, three probes can be configured:
Startup
: Is the container ready and did it start? When this probe succeeds, Kubernetes switches to the other probes.Liveness
: Did the application crash or deadlock? If this fails, the pod is stopped, and a new container instance is created.Readiness
: Is the application ready to receive requests? If this fails, no requests are sent to this service instance, but the pod keeps running.
Because Azure Container Apps is based on Kubernetes, these three probes can be configured with this Azure service as well.
Adding health checks to the DI container
Health checks can be configured with the DI container...