Repository navigation
Show anonymous dashboard URLs in aspire ps - #15731
Conversation
aspire ps
| { | ||
| baseUrlWithLoginToken = $"{apiBaseUrl.TrimEnd('/')}/login?t={dashboardOptions.DashboardToken}"; | ||
| baseUrlWithLoginToken = !string.IsNullOrEmpty(dashboardOptions.DashboardToken) | ||
| ? $"{apiBaseUrl.TrimEnd('/')}/login?t={dashboardOptions.DashboardToken}" |
There was a problem hiding this comment.
Should it Uri.EscapeDataString the token?
There was a problem hiding this comment.
Copilot Ensure the dashboardtoken used in the query value is valid. Escape/encode invalid characters
There was a problem hiding this comment.
Cool, copilot did something else and ignored this comment.
I don't think this is nessessary because the token is always a hex string.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15731Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15731" |
|
Copilot address the feeback |
There was a problem hiding this comment.
Pull request overview
Updates the Aspire Hosting backchannel so aspire ps can display a dashboard URL even when the dashboard is configured for anonymous (unsecured) access, aligning CLI output behavior with tokenized dashboards.
Changes:
- Update dashboard URL resolution to return the base dashboard URL when no browser token is configured (while preserving
/login?t=...when a token exists). - Add a hosting regression test covering anonymous dashboard URL behavior via the auxiliary backchannel.
- Add a CLI regression test ensuring
ps --format jsonincludes the anonymous dashboard URL.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Aspire.Hosting/Backchannel/DashboardUrlsHelper.cs | Returns the base URL when no dashboard browser token is configured; keeps tokenized /login?t=... behavior and Codespaces rewriting. |
| tests/Aspire.Hosting.Tests/Backchannel/AuxiliaryBackchannelRpcTargetTests.cs | Adds a regression test for anonymous dashboard mode in the auxiliary backchannel. |
| tests/Aspire.Cli.Tests/Commands/PsCommandTests.cs | Adds a regression test verifying ps --format json includes the dashboard URL in anonymous mode. |
e0ab2e5 to
716e7c9
Compare
|
/backport to release/13.2 |
|
🎬 CLI E2E Test Recordings — 52 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23833883431 |
|
Started backporting to |
|
James Newton-King (@JamesNK) backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Creating an empty commit: Initial plan
Applying: fix: show anonymous dashboard url in ps output
Applying: docs: align dashboard url contract comments
error: sha1 information is lacking or useless (src/Aspire.Hosting/Backchannel/DashboardUrlsHelper.cs).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0003 docs: align dashboard url contract comments
Error: The process '/usr/bin/git' failed with exit code 128 |
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: davidfowl <[email protected]> Co-authored-by: JamesNK <[email protected]>
Co-authored-by: Copilot <[email protected]> Co-authored-by: davidfowl <[email protected]> Co-authored-by: JamesNK <[email protected]>
|
No documentation PR is required for this change. Reason: This is a bug fix that restores expected behavior —
|

Description
aspire psleft the Dashboard column empty when the AppHost was configured withASPIRE_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS/DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS, even though the dashboard was running and reachable. This change makes the backchannel surface the dashboard base URL in anonymous mode so CLI output can display it the same way it already does for tokenized dashboards.Backchannel behavior
/login?t=...behavior when a browser token is configured.CLI coverage
ps --format jsonto verify anonymous dashboard URLs are included.Hosting coverage
Follow-up cleanup
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: