Health Check Endpoint

951 Views Asked by At

I need to create an azure function (HTTP Trigger) to perform healthcheck. It should return status code 200 if everything is ok and 500 if a problem occurred.

[FunctionName("Name")]
    public static async Task<IActionResult> Run(
        [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = "health")] HttpRequest req,
        ILogger log)
    {
        //Check eventhub and queue healthcheck if ok
           //return status code 200
        // If not ok
          // return internal server error
    }

This function should check eventhub and queue. I am not sure how to create this endpoint and I found several resource I am not able to figure it out

0

There are 0 best solutions below