aspire-configuration

Configure .NET Aspire AppHost to emit configuration via environment variables.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill aspire-configuration-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aspire-configuration
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/aspire-configuration
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill aspire-configuration-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you configure your .NET Aspire AppHost to explicitly emit application configuration via environment variables, ensuring your application code remains clean and free from Aspire client dependencies and service discovery mechanisms.

Core Features & Use Cases

  • Explicit Configuration Mapping: Wire AppHost resources directly to application configuration keys.
  • Production Parity: Ensure configuration is transparent and portable outside of the Aspire environment.
  • Avoids Aspire Client Packages: Keeps application projects free from Aspire client/service-discovery packages.
  • Use Case: When developing an Aspire application, you want to ensure that the database connection string and blob storage endpoint, provisioned by the AppHost, are exposed as standard environment variables that your application can bind to using IOptions<T>, rather than relying on Aspire's built-in service discovery.

Quick Start

Use the aspire-configuration skill to map the 'postgres' resource to the 'ConnectionStrings__Postgres' configuration key in the AppHost.

Frequently Asked Questions about aspire-configuration

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

FAQPage Schema
How do I decouple .NET Aspire AppHost from application configuration?

To decouple .NET Aspire AppHost from application configuration, configure the AppHost to emit explicit environment variables. This allows application code to bind directly to IOptions<T> without relying on Aspire client packages or service discovery.

Why does my .NET Aspire application require Aspire client packages to read resource configuration?

Your .NET Aspire application requires Aspire client packages because the AppHost is not emitting explicit configuration. By wiring AppHost resources to standard environment variables, your app can use standard Configuration bindings and avoid these dependencies.

Can I bind .NET Aspire provisioned resources to standard IOptions<T> without service discovery?

Yes, you can bind .NET Aspire provisioned resources to standard IOptions<T> without service discovery. The AppHost can be configured to emit explicit configuration via environment variables, allowing standard .NET Configuration binding outside the Aspire environment.

What is the best way to ensure .NET Aspire configuration transparency for production portability?

The best way to ensure .NET Aspire configuration transparency for production portability is mapping AppHost resources directly to application configuration keys as environment variables. This decouples application code from Aspire clients, ensuring configuration works outside the Aspire environment.

How do I map a Postgres resource to a connection string environment variable in .NET Aspire?

To map a Postgres resource to a connection string environment variable in .NET Aspire, configure the AppHost to wire the 'postgres' resource to the 'ConnectionStrings__Postgres' configuration key. This exposes the database connection as a standard environment variable.

Does configuring .NET Aspire AppHost environment variables limit production service discovery?

Configuring .NET Aspire AppHost environment variables does not limit production service discovery; it enhances production parity. By emitting explicit configuration, applications remain portable and transparent outside Aspire, avoiding forced dependencies on Aspire client packages.