You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Environment variable naming convention for resources not documented #477
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 vars MY_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.
Scope — add a documented reference for Aspire's resource-name → environment-variable transformation rules, with worked examples covering hyphenated names and connection strings.
Where to add
Primary: src/frontend/src/content/docs/app-host/ — add a new short reference page (suggested filename environment-variables.mdx) and link it from the App Host fundamentals nav so it's discoverable.
Cross-link from any existing page that documents WithEnvironment/WithReference/connection-string consumption so a reader looking up env-var usage finds it.
Content (use the spec from the issue body verbatim, expanded into prose + an examples table):
Resource names are uppercased.
Hyphens (-) are replaced with underscores (_).
Property values are appended as _{PROPERTY} (e.g. _URI, _MODELNAME, _CONNECTIONSTRING).
Connection strings use the format ConnectionStrings__{resource-name} (note: the resource-name retains its original casing/hyphens for the connection-string key).
End with the worked example from the issue: resource "foundry-demo-proj" → env vars FOUNDRY_DEMO_PROJ_URI, FOUNDRY_DEMO_PROJ_MODELNAME, ConnectionStrings__foundry-demo-proj. Call out that this is especially important for non-.NET service projects (Python, Node.js, etc.) that read env vars directly rather than going through a typed client integration.
Acceptance
New page renders, is reachable from the App Host nav, and uses Aspire docs MDX conventions (frontmatter, code blocks with language tags, etc.).
Example table covers at least: single-word resource, hyphenated resource, connection-string variant.
npm run build in src/frontend/ passes.
JA mirror under src/frontend/src/content/docs/ja/app-host/ either gets a translated copy or a clearly-marked TODO(translate) placeholder linking back to the EN page.
Activity
IEvangelist commentedon Jun 2, 2026
Triage → @Copilot
Scope — add a documented reference for Aspire's resource-name → environment-variable transformation rules, with worked examples covering hyphenated names and connection strings.
Where to add
src/frontend/src/content/docs/app-host/— add a new short reference page (suggested filenameenvironment-variables.mdx) and link it from the App Host fundamentals nav so it's discoverable.WithEnvironment/WithReference/connection-string consumption so a reader looking up env-var usage finds it.Content (use the spec from the issue body verbatim, expanded into prose + an examples table):
-) are replaced with underscores (_)._{PROPERTY}(e.g._URI,_MODELNAME,_CONNECTIONSTRING).ConnectionStrings__{resource-name}(note: the resource-name retains its original casing/hyphens for the connection-string key)."foundry-demo-proj"→ env varsFOUNDRY_DEMO_PROJ_URI,FOUNDRY_DEMO_PROJ_MODELNAME,ConnectionStrings__foundry-demo-proj. Call out that this is especially important for non-.NET service projects (Python, Node.js, etc.) that read env vars directly rather than going through a typed client integration.Acceptance
npm run buildinsrc/frontend/passes.src/frontend/src/content/docs/ja/app-host/either gets a translated copy or a clearly-markedTODO(translate)placeholder linking back to the EN page.