A minimal sample showing how .NET Aspire composes SQL Server + Data API Builder (DAB) + a Razor Pages UI. AppHost wires resources and injects configuration at runtime.
| Project | Purpose |
|---|---|
AppHost |
Orchestrates SQL Server, Data API Builder container, Redis, MCP Inspector, and the Web project with Aspire. |
Database |
SQL project (.sqlproj) defining schema and seed script. |
Web |
Razor Pages frontend consuming DAB endpoints and Azure AI Foundry. |
api/dab-config.json |
Mounted into the DAB container (provided in repo). No manual connection string edits required. |
- .NET 8 SDK
- Docker Desktop running
- Azure AI Foundry API key (for chat)
- Restore and build:
dotnet restoredotnet build
- Run the Aspire host:
dotnet run --project AppHost
- When prompted or via env vars, provide:
ASPIRE_PARAMETER_sql-passwordASPIRE_PARAMETER_azure-aifoundry-apikey
- Open the Aspire Workbench links:
- Web UI:
web-app - DAB:
/swagger,/graphql,/health - Redis Commander (optional): root
- MCP Inspector (developer tool)
- Web UI:
- SQL data volume is optional and can be enabled in
AppHost/AppHost.cs. - OTLP exporter can be configured; set
OTEL_EXPORTER_OTLP_ENDPOINTif using Aspire Dashboard. - DAB config bind-mount path:
api/dab-config.json.
Add a license (e.g., MIT) at the root.