Skip to content

Add env support to Aspire debug launch configuration#16449

Merged
adamint merged 1 commit intomicrosoft:mainfrom
adamint:dev/adamint/issue-16445
Apr 24, 2026
Merged

Add env support to Aspire debug launch configuration#16449
adamint merged 1 commit intomicrosoft:mainfrom
adamint:dev/adamint/issue-16445

Conversation

@adamint
Copy link
Copy Markdown
Member

@adamint adamint commented Apr 24, 2026

Description

Adds launch configuration schema support for env and args on Aspire debug configurations so VS Code recognizes the existing launch settings without warnings.

The env configuration is now wired into the Aspire CLI spawn options when launching an AppHost. The existing args setting is also declared in the schema. This change includes package manifest coverage for both schema entries and fixes the related launch profile working-directory tests to use platform-correct absolute paths.

Validation:

  • cd extension && npx tsc --noEmit -p tsconfig.json
  • cd extension && npm run compile-tests
  • cd extension && npm run lint
  • cd extension && npm test (324 passing)

Fixes #16445

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Copilot AI review requested due to automatic review settings April 24, 2026 22:54
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16449

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16449"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Aspire VS Code extension’s debug launch configuration schema to officially support env and args, and wires env into the Aspire CLI process spawn so existing launch.json settings are recognized and applied without VS Code schema warnings.

Changes:

  • Add args (string array) and env (string-valued object) to the aspire debugger launch schema (including localization strings).
  • Pass env from the debug configuration into the CLI spawn options when launching an AppHost.
  • Extend/adjust tests to validate schema entries and use platform-correct absolute paths for working directory tests.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
extension/src/test/packageManifest.test.ts Adds manifest coverage tests asserting args and env are declared correctly in the debugger schema.
extension/src/test/launchProfiles.test.ts Updates working-directory tests to use platform-correct absolute paths instead of hardcoded Windows paths.
extension/src/debugger/AspireDebugSession.ts Converts debug configuration env to EnvVar[] and passes it to spawnCliProcess.
extension/src/dcp/types.ts Extends AspireExtendedDebugConfiguration with an optional env property.
extension/package.nls.json Adds localized strings for the new args and env schema descriptions.
extension/package.json Declares args and env in contributes.debuggers[].configurationAttributes.launch.properties.
extension/loc/xlf/aspire-vscode.xlf Adds localization entries for the new debug configuration strings.

@adamint adamint enabled auto-merge (squash) April 24, 2026 23:14
@github-actions
Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

@adamint adamint merged commit f5faf88 into microsoft:main Apr 24, 2026
565 of 568 checks passed
@github-actions github-actions Bot added this to the 13.3 milestone Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VS Code extension: "aspire" launch configuration does not accept environment variables

3 participants