Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor Server app with many requests make website unstable

$
0
0

I created Blazor server web app and I deployed on Azure App Service, and in Network tab I see alot of requests to https://mywebsites0123.azurewebsites.net/_blazor?id=3OO-T6L4Bu9bMRF8QAo_5Q&_=166722 and make application unstable.

On localhost (Debug and Release) I cannot find any request and application is working smooth.

I read this C# Blazor server - why so many _blazor requests and such memory consumption? but can't find solution.

The startup page looks like:

ConfigureServices(IServiceCollection services)

 services.AddRazorPages();services.AddServerSideBlazor().AddMicrosoftIdentityConsentHandler();services.AddSignalR(e =>{                e.MaximumReceiveMessageSize = 2000 * 1024;});// Radzen initservices.AddScoped<DialogService>();services.AddScoped<TooltipService>();services.AddScoped<NotificationService>();services.AddMemoryCache();var apiScope = Configuration["Authentication:ApiScope"];services.AddMicrosoftIdentityWebAppAuthentication(Configuration, "Authentication:AzureAd").EnableTokenAcquisitionToCallDownstreamApi(new string[] { apiScope }).AddInMemoryTokenCaches();services.AddControllersWithViews().AddMicrosoftIdentityUI();services.AddAuthorization();

and

Configure(IApplicationBuilder app, IWebHostEnvironment env)

if (env.IsDevelopment()){   app.UseDeveloperExceptionPage();}else{    app.UseExceptionHandler("/Error");    app.UseHsts();}app.UseHttpsRedirection();app.UseStaticFiles();app.UseRouting();app.UseAuthentication();app.UseAuthorization();app.UseEndpoints(endpoints =>{    endpoints.MapControllers();    endpoints.MapBlazorHub();    endpoints.MapFallbackToPage("/_Host");});

I receive alot of requests:enter image description here

After few seconds later:

enter image description here

And then number of requests continue to increase. Don't know why this happens when app is hosted on Azure app service.

Any tips to look for ?

Solution:

Enable on Azure AppService the WebSockets (by default is Off) described: https://learn.microsoft.com/en-us/aspnet/core/signalr/publish-to-azure-web-app?view=aspnetcore-6.0#configure-the-app-in-azure-app-service

enter image description here


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>