aspire-configuration

Configure Aspire AppHost to emit explicit environment variable configuration for applications.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/AGIBuild/dotnet.CI.template --skill aspire-configuration-agibuild
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: aspire-configuration
Source: https://github.com/AGIBuild/dotnet.CI.template/tree/main/.cursor/skills/aspire-configuration
Command: npx skills add https://github.com/AGIBuild/dotnet.CI.template --skill aspire-configuration-agibuild

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Aspire applications often become tightly coupled to Aspire client packages and opaque service discovery, making production configuration hard to reproduce outside the orchestrator. This Skill guides you to keep all Aspire infrastructure in the AppHost and expose only explicit configuration keys to application code. ## Core Features & Use Cases - Explicit Configuration Mapping: Translate AppHost resources (databases, containers, endpoints) into concrete environment variables via WithEnvironment and WithReference. - Aspire-Free Application Code: Keep app projects free of Aspire client and service-discovery packages by binding only to IOptions<T> and Configuration. - Production Parity: Ensure every AppHost-injected value can be reproduced as plain env vars or config files in production without Aspire. - Use Case: You are wiring a Postgres database and a MinIO container to an API in an Aspire AppHost. Use this Skill to map connection strings and blob storage settings into explicit config keys so the API runs identically in production with plain environment variables. ## Quick Start Ask the AI to wire your Aspire AppHost resources to your API using explicit environment variable configuration without adding Aspire client packages to the app project.

Frequently Asked Questions about aspire-configuration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pass Aspire AppHost resource settings to my application?▼

Use WithEnvironment in the AppHost to map resource outputs to explicit configuration keys, and WithReference for connection strings. The application then reads these values through Configuration or IOptions<T> without any Aspire-specific code.

Should my app projects reference Aspire client or service discovery packages?▼

No. Aspire hosting and client packages belong only in the AppHost project. Application projects should bind to IOptions<T> or Configuration and initialize SDKs directly, keeping orchestration concerns out of app code.

Can Aspire-injected configuration work in production without Aspire?▼

Yes, if every value injected by the AppHost is an explicit environment variable or config key. Avoid opaque service discovery so the same settings can be supplied as plain env vars or config files in production.

How do I handle feature toggles and test overrides in Aspire?▼

Keep toggles in configuration and drive them through the AppHost, for example reading an AppHostConfiguration section and conditionally calling WithEnvironment or disabling data volumes. Test fixtures can pass overrides through DistributedApplicationTestingBuilder.

What are the limitations of relying on Aspire service discovery?▼

Service discovery creates implicit configuration that cannot be mirrored in production environments without Aspire. This breaks production parity and hides settings, so explicit environment variable mapping is preferred for portable deployments.