microsoft / microsoft/aspire

[Dashboard] Explicit dashboard run options should override environment values

Open Beginner friendly
#19,779 1 comment 0 reactions 0 assignees View on GitHub
area-cli area-dashboard triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 12h
Merged PRs (30d)
201

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

`DashboardRunCommand.AddStringOptionArg` checks whether the mapped environment setting exists before reading an explicitly supplied CLI option. If it exists, `--persistence` or `--application-name` is not forwarded to the Dashboard, so the inherited environment value wins.

This can persist data despite an explicit `--persistence None`, or select a different `Resume` database than the application name supplied on the command line.

### Expected Behavior

Explicit CLI options should take precedence over inherited environment values.

### Steps To Reproduce

1. Set `ASPIRE_DASHBOARD_PERSISTENCE_MODE=Run`.
2. Run `aspire dashboard run --persistence None`.
3. Inspect the child Dashboard arguments or resulting storage mode.
4. The environment value is used instead of the explicit CLI value.

### Exceptions (if any)

N/A

### Aspire doctor output

```plain
Aspire CLI 13.6.0-pr.18924.g5ee63941
Windows 10.0.26200 and Ubuntu 24.04.3
```

### Anything else?

Related to #18924. Source: `src/Aspire.Cli/Commands/DashboardRunCommand.cs:181-216,244-269`. The same implementation remains on current `main`.

Contributor guide

Open the contributing guide

Research direction

Start in src/Aspire.Cli/Commands/DashboardRunCommand.cs, especially lines 181-216 and 244-269, and inspect how AddStringOptionArg handles environment settings versus explicitly supplied options. Reproduce the issue with ASPIRE_DASHBOARD_PERSISTENCE_MODE=Run and --persistence None, then verify that explicit --persistence and --application-name values are forwarded to the Dashboard and take precedence.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.