I could not find any resources to add health checks to a HTTPTrigger function app, running in .NET 5.0 Isolated.
static async Task Main()
{
var host = new HostBuilder()
.ConfigureAppConfiguration(configurationBuilder =>
{
configurationBuilder.AddEnvironmentVariables();
})
.ConfigureFunctionsWorkerDefaults()
.ConfigureServices((builder, services) =>
{
var configuration = builder.Configuration;
services.AddDbContext(configuration);
// Add healthcheck here
services.AddHealthChecks()
// ...
// Map health checks
})
.Build();
await host.RunAsync();
}
This guide states I can add MapHealthChecks (but in asp.net core)
var app = builder.Build();
app.MapHealthChecks("/healthz");
app.Run();
How do I translate this to run in my dotnet-isolated application?