Skip to content

[Blazor] Aspire integration improvements #64888

@javiercn

Description

@javiercn

This issue tracks the work to integrate Blazor applications with Aspire, enabling Blazor apps to benefit from Aspire's orchestration, service discovery, telemetry, and configuration capabilities.

Overview

The integration provides first-class support for all Blazor hosting models (WebAssembly, Server, and Blazor Web) within .NET Aspire applications, using a Backend-for-Frontend (BFF) pattern via a Blazor Gateway component.

Key Features

Blazor Gateway provides:

  • Optimized serving of WebAssembly static assets with MapStaticAssets (compression & caching)
  • API proxying to backend services (eliminates CORS requirements)
  • Configuration flow to WebAssembly clients via /_blazor/_configuration
  • Session affinity for multi-replica Blazor Server scenarios
  • Replacement for the Dev Server in both development and production

Hosting Scenarios

Scenario Gateway Configuration
Standalone WebAssembly + Aspire Separate node (defined in AppHost)
Hosted WebAssembly Embedded in host project
Blazor Server (single replica) Not required
Blazor Server (multi-replica) Separate node (load balancing + session affinity)
Blazor Web (Server + WASM) Embedded or separate (based on replica count)

Related Work Items

Sub-issues

Metadata

Metadata

Assignees

Labels

area-blazorIncludes: Blazor, Razor Components

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions