Blazor HealthChecks - works on my system, error on Azure App Server

David Thielen 3,121 Reputation points
2024-07-06T15:57:46.3866667+00:00

Hi all;

I have a Blazor Interactive Server app and have set up health checks as follows:

builder.Services.AddHealthChecks()
    .AddDbContextCheck<TrackingDbContext>("App Database")
    .AddDbContextCheck<UserDbContext>("Identity Database");

app.MapHealthChecks("health", new HealthCheckOptions
{
    ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
}).AllowAnonymous();

When I run on my system using the Visual Studio integrated app server, https://localhost:7229/health gives me JSON output with the status of each check.

When I run on this same app on Azure App Server using https://ohana.tradewindsstudios.us/health I get:

Error.
An error occurred while processing your request.
Request ID: 00-f4dd263c9fd8791cf7c9dda48954031a-09ba2674b6a1313b-00
  1. Where do I find details on this error?
  2. Is there something I need to set in App Server to allow this to work?

thanks - dave

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,618 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,595 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,918 questions
{count} votes

Accepted answer
  1. ajkuma 26,721 Reputation points Microsoft Employee
    2024-07-08T06:30:09.73+00:00

    Apologies for the delayed response from over the weekend. To fetch more details, you may view the Application event Logs, checkout this doc for more details: #application-event-log-azure-app-service
     Based on my understanding of your issue, just to highlight, hosting a Blazor Web App that uses interactive server-side rendering on Azure App Service requires configuration for Application Request Routing (ARR) affinity and WebSockets. The App Service should also be appropriately globally distributed to reduce UI latency. 

    It is recommend using WebSockets for server-side Blazor apps deployed to Azure App Service. Host and deploy server-side Blazor apps

    Also, I see that you have posted it on SO and your previous discussion on this topic.

    Ref: Monitor App Service instances using Health check


     If the answer helped (pointed, you in the right direction) > please click Accept Answer - it will benefit community members to find the answers quickly. 

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.