-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Bug Description
Aspire transforms resource names into environment variable prefixes using a specific convention, but this convention is not clearly documented. When a resource is named with hyphens (e.g., foundry-demo-proj), the resulting environment variable prefix is FOUNDRY_DEMO_PROJ (uppercased, hyphens replaced with underscores). Properties are appended as suffixes (e.g., _URI, _MODELNAME).
Current Behavior
There is no clear documentation explaining the resource name → environment variable transformation rules. Users must discover the naming convention by trial and error or by inspecting the Aspire dashboard.
Expected Behavior
The docs should include a section explaining:
- Resource names are uppercased
- Hyphens (
-) are replaced with underscores (_) - Properties are appended as
_{PROPERTY}(e.g.,_URI,_MODELNAME,_CONNECTIONSTRING) - Connection strings use the format
ConnectionStrings__{resource-name} - Examples showing the mapping, e.g.: resource
"my-db"→ env varsMY_DB_HOST,MY_DB_PORT,ConnectionStrings__my-db
Page URL
Could be added to the app model fundamentals or a dedicated "environment variables" reference page.
Additional Context
We spent significant debugging time because our Python app referenced PROJ_URI when the actual variable was FOUNDRY_DEMO_PROJ_URI (resource was named foundry-demo-proj). This is especially impactful for non-.NET service projects (Python, Node.js) where developers must manually read environment variables rather than using typed Aspire client integrations.