aspire-configuration
Agent skill fromAaronontheweb/dotnet-skills
Configure Aspire AppHost to emit explicit app config via environment variables; keep app code free of Aspire clients and service discovery.
How to install aspire-configuration
install aspire-configuration
# install the dotnet-skills pack with the skills CLI
npx skills add Aaronontheweb/dotnet-skills# or add only this skill to Claude Code: copy the folder
skills/aspire-configuration/
# into
~/.claude/skills/aspire-configuration/ (all projects)
.claude/skills/aspire-configuration/ (one project)
1# Aspire Configuration23## When to Use This Skill45Use this skill when:6- Wiring AppHost resources to application configuration in Aspire-based repos7- Ensuring production configuration is transparent and portable outside of Aspire8- Avoiding Aspire client/service-discovery packages inside application code9- Designing feature toggles for dev/test without changing app code paths1011---1213## Core Principles14151. **AppHost owns Aspire infrastructure packages**16 - Aspire Hosting packages belong in AppHost only.17 - App projects should not reference Aspire client/service-discovery packages.18192. **Explicit configuration only**20 - AppHost must translate resource outputs into explicit config keys (env vars).21 - App code binds to `IOptions<T>` or `Configuration` only.22233. **Production parity and transparency**24 - Every value injected by AppHost must be representable in production as env vars25 or config files without Aspire.26 - Avoid opaque service discovery and implicit configuration.2728---2930## Configuration Flow3132```33AppHost resource -> WithEnvironment(...) -> app config keys -> IOptions<T> in app34```3536The AppHost is responsible for turning Aspire resources into explicit app settings.37The application never consumes Aspire clients or service discovery directly.3839---4041## AppHost Patterns (Explicit Mapping)4243### Example: Database + Blob Storage4445```csharp46// AppHost/Program.cs47var builder = DistributedApplication.CreateBuilder(args);48…
Excerpt shown under the repository's MIT license.
