Search code examples
azure-webjobshealth-checkreadinessprobe

Health and Liveness probe for Azure Web Jobs


We are setting up a time-triggered background job that needs to connect to multiple resources, like SFTP, Azure Blob, Azure SQL, etc. The idea is to leverage Azure's Web Job capability to host the service on Azure's App Service.

We have a requirement that we need to host heathiness and readiness APIs just like the one's for containerized solutions. First, of all is it recommended to have those for background running jobs as they will only be running for a certain time.

And am absolutely unsure if this can be done, read a couple of articles online but i do not see anything that directs me to the answer that i am seeking.


Solution

    • Azure Web Jobs can be configured to have healthiness and readiness APIs.

    • Azure Container Apps are based on Kubernetes health probes and can be set up using either TCP or HTTP(S) exclusively.

    • The probes supported by Container Apps include Liveness, Readiness, and Startup.

    • The Liveness probe reports the overall health.

    • To enable Health check, browse to the Azure portal and select your App Service app. Under Monitoring, select Health check. Select Enable and provide a valid URL path on your application, such as /health or /api/health.

    • Create a Azure WebJobs.

    enter image description here

    enter image description here

    • Create a Azure WebJobs Health with Application Insights with https://{webapp-name}.scm.azurewebsites.net/api/triggeredwebjobs/{webjob-name}.

      enter image description here

    • The Monitor Azure WebJobs status with Azure Application Insights are displayed in the image below. Thank @pacodelacruz

    enter image description here