aspire-configuration

Translate Aspire AppHost resource outputs into environment variables and config keys.

1.1k|101|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill aspire-configuration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aspire-configuration
Source: https://github.com/Aaronontheweb/dotnet-skills/tree/main/skills/aspire-configuration
Command: npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill aspire-configuration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams decouple .NET apps from Aspire hosting by translating Aspire AppHost outputs into explicit environment variables and configuration keys, keeping application code free of Aspire clients and service-discovery concerns.

Core Features & Use Cases

  • Explicit config mapping: converts Aspire resource outputs into clear env vars and config sections that the app can bind to IOptions<T>.
  • Production parity: ensures all external dependencies can be reproduced in production without Aspire runtime.
  • Safe isolation: keeps Aspire hosting logic inside AppHost only, avoiding coupling in application projects.

Quick Start

Configure Aspire resources to be exposed as environment variables for your app using AppHost, then reference those keys in your app's configuration and options pattern.

Frequently Asked Questions about aspire-configuration

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

FAQPage Schema
How do I expose Aspire AppHost resource outputs as environment variables in .NET?

You can expose Aspire AppHost resource outputs as environment variables by configuring explicit mappings in the AppHost, which decouples your application code from Aspire clients and service-discovery concerns. This allows the app to bind config sections directly to IOptions<T>.

Why should I decouple application code from Aspire clients for local development?

Decoupling application code from Aspire clients ensures production parity by representing every external dependency as explicit configuration, allowing the app to run in production without the Aspire runtime while keeping hosting logic isolated inside the AppHost.

Can I bind Aspire environment variables directly to IOptions<T> in my .NET app?

Yes, you can bind Aspire environment variables to IOptions<T> by establishing explicit config mappings that convert AppHost resource outputs into clear configuration sections, which the application can then bind to strongly typed options objects.

What's the best way to achieve production parity when using .NET Aspire AppHost?

The best way to achieve production parity with .NET Aspire AppHost is translating resource outputs into explicit environment variables, ensuring all external dependencies like databases and containers can be reproduced in production without requiring the Aspire runtime.

Does restricting Aspire client usage to the AppHost break service discovery in .NET?

Restricting Aspire client usage to the AppHost does not break service discovery; instead, it enforces safe isolation by pushing service-discovery concerns into explicit environment variable mappings, keeping application projects decoupled from Aspire hosting logic.