Watch Aspire live streamsDocsTry Aspire

Get started with Blazor hosting

Blazor logo

The Aspire Blazor hosting integration helps you model a Blazor WebAssembly project and a Blazor Gateway as first-class resources in your AppHost. You can orchestrate the frontend and backing APIs together, and keep endpoint wiring in one place.

The integration adds AppHost APIs that let you:

Using Blazor hosting in Aspire gives you:

  • One app model for frontend and APIs. Model your Blazor client and backend services in the same AppHost.
  • Consistent endpoint wiring. Use AppHost references instead of manually tracking endpoint URLs.
  • Gateway-first browser entry point. Expose a single external gateway endpoint for browser traffic.
  • Dashboard visibility. See frontend and API resources together in the Aspire dashboard.

The Blazor hosting integration is a hosting-side API surface. You install it in your AppHost, define Blazor and API resources, and connect them through references and the gateway.

ClientAppHostBrowserBlazor hosting integrationBlazor WebAssembly appBlazor GatewayAPI project
  1. Add the hosting package, create the Blazor WebAssembly and gateway resources, and associate them with WithBlazorClientApp / withBlazorClientApp.

    Set up Blazor hosting in the AppHost

  2. Use AppHost references to expose service discovery properties for backend APIs and other consumers.

    Connect Blazor apps and APIs