public IActionResult Get() { var healthViloationMessage = _healthService.GetHealthViolationMessage(); if (healthViloationMessage != null) { return(StatusCode((int)HttpStatusCode.InternalServerError, new ErrorResponse { ErrorMessage = $"Job is unhealthy: {healthViloationMessage}" })); } // NOTE: Feel free to extend IsAliveResponse, to display job-specific health status return(Ok(new IsAliveResponse { Version = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion, Env = Environment.GetEnvironmentVariable("ENV_INFO"), HealthWarning = _healthService.GetHealthWarningMessage() ?? "No", #if (examples) // NOTE: Health status information example: LastFooStartedMoment = _healthService.LastFooStartedMoment, LastFooDuration = _healthService.LastFooDuration, MaxHealthyFooDuration = _healthService.MaxHealthyFooDuration #endif })); }