WEBSITE_SWAP_WARMUP_PING_PATH: /statuscheck WEBSITE_SWAP_WARMUP_PING_STATUSES: 200
WEBSITE_ADD_SITENAME_BINDINGS_IN_APPHOST_CONFIG: 1 //prevent random cold starts
This is an example for ASP.NET Core
public class statuscheckModel : PageModel
{
private readonly IRepo _repo;
public statuscheckModel(IRepo repo)
{
_repo = repo;
}
public StatusCodeResult OnGet()
{
// let's get the locations from the repo
var locations = _repo.Locations;
// if the object exists and there is more than 1 item, return status ok
if (locations != null && locations.Count() > 0)
{
return StatusCode(StatusCodes.Status200OK);
}
return StatusCode(StatusCodes.Status418ImATeapot);
}
}