I need to implement the Health Check for Azure Functions.
https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks?view=aspnetcore-3.0
But, in my case instead of using NETCORE 3.0 we need to implement it in NETCORE 2.2
Our main problem is the startup class which inherits from the FunctionsStartup which it is quite different from MVC API startup. Thus, the following code could not be implemented in the Startup.cs
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
//Readiness check
var port = int.Parse(Configuration["HealthManagementPort"]);
app.UseHealthChecks("/ready", port, new HealthCheckOptions()
{
Predicate = (check) => check.Tags.Contains("ready"),
});
app.UseHealthChecks("/live", port, new HealthCheckOptions()
{
//Exclude all checks and return 200-OK
Predicate = (_) => false,
});
}
Have any anyone faced something similar? How can I implement similar behavior?
Thanks.