
A Microsoft Aspire .NET 9 solution that demonstrates a distributed application architecture with Blazor Server Web App and containerized services.
This solution implements the following components:
- BlazorOrchistrator.AppHost - Aspire orchestration host that manages all services
- BlazorOrchistrator.Web - Blazor Server Web Application with interactive components
- BlazorOrchistrator.Scheduler - Background service for scheduled tasks
- BlazorOrchistrator.Agent - Containerized worker service that can run with multiple replicas
- Azure Storage - Blob and Queue storage integration
- SQL Server - Database services with Entity Framework Core
- Container Orchestration - Agent service configured for 2 replicas
- .NET 9.0 SDK
- Docker Desktop (for container services)
- Aspire workload:
dotnet workload install aspire
For development without full Aspire orchestration:
-
Run the Blazor Web App:
cd src/BlazorOrchistrator.Web dotnet run
Navigate to
http://localhost:5287
-
Run the Scheduler Service:
cd src/BlazorOrchistrator.Scheduler dotnet run
-
Run the Agent Service:
cd src/BlazorOrchistrator.Agent dotnet run
To run the complete orchestrated solution:
cd src/BlazorOrchistrator.AppHost
dotnet run
This will start all services and the Aspire dashboard.
src/
├── BlazorOrchistrator.AppHost/ # Aspire orchestration host
├── BlazorOrchistrator.Web/ # Blazor Server web application
├── BlazorOrchistrator.Scheduler/ # Background scheduler service
└── BlazorOrchistrator.Agent/ # Containerized agent service
└── Dockerfile # Container configuration
The solution is configured to:
- Use in-memory databases in development mode
- Switch to SQL Server and Azure Storage when running with Aspire orchestration
- Support multiple replicas of the Agent service
- Provide proper service discovery and health monitoring
- The solution uses conditional service registration based on environment
- In development mode, Azure Storage services are mocked/disabled
- Entity Framework contexts are properly scoped to avoid DI conflicts
- All services include comprehensive logging
# Build the entire solution
dotnet build
# Run tests (if any)
dotnet test
# Restore packages
dotnet restore
The Agent service includes a Dockerfile for containerization. To build and run:
cd src/BlazorOrchistrator.Agent
docker build -t blazor-orchestrator-agent .
docker run blazor-orchestrator-agent