-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Milestone
Description
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
- Server-side configuration endpoint for Blazor Web ([Blazor] Provide the ability to flow configuration from the host to the browser #30116)
- IHostedService support in WebAssembly (Support hosted services in WebAssemblyHost #63637)
- Environment variables in IConfiguration by default ([Blazor] Add environment variables to IConfiguration by default in WebAssemblyHostBuilder #64576)
- Gateway package for standalone Blazor WebAssembly ([Blazor] Gateway package for standalone Blazor WebAssembly applications #64573)
- WebAssembly service defaults template ([Blazor] WebAssembly service defaults template for Aspire integration #64574)
- Consider enabling MetricsSupport/EventSourceSupport by default ([Blazor] Consider enabling MetricsSupport and EventSourceSupport by default for WebAssembly #64575)
- Register Components metric and tracing by default on webassembly host ([Blazor] Register Components metric and tracing by default on webassembly host. #64736)
Reactions are currently unavailable
Sub-issues
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components