Always log dashboard startup summary across auth modes#17206
Conversation
Previously the dashboard login URL was only logged when FrontendAuthMode was BrowserToken. When running standalone without browser-token auth, no URL was printed at all. Now WriteDashboardUrl handles a null/empty token gracefully by logging the base dashboard URL instead of the login link. The auth mode guard in DashboardWebApplication is removed so a URL is always printed at startup. Fixes #16095
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17206Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17206" |
There was a problem hiding this comment.
Pull request overview
This PR ensures the Aspire dashboard startup logging always includes a usable dashboard URL, even when browser-token authentication is not active.
Changes:
LoggingHelpers.WriteDashboardUrlnow accepts null/empty tokens and logs the base dashboard URL.DashboardWebApplicationnow always calls the helper for the frontend endpoint.- Added unit coverage for token, no-token, invalid URL, and multi-URL scenarios.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Shared/LoggingHelpers.cs |
Updates dashboard URL logging behavior for token and no-token modes. |
src/Aspire.Dashboard/DashboardWebApplication.cs |
Removes the browser-token-only guard so startup logs always include the dashboard URL. |
tests/Aspire.Dashboard.Tests/LoggingHelpersTests.cs |
Adds tests covering the updated logging helper behavior. |
dfc4e7b to
c882947
Compare
c882947 to
12bdff9
Compare
- WriteDashboardSummary now logs OTLP endpoints even without a valid dashboard URL - Moved WriteDashboardSummary call outside frontendEndpointInfo null check - Simplified URL parsing (single URLs, no delimiter handling) - Added tests for null/invalid dashboard URL scenarios
8dfdfb4 to
53faa6c
Compare
|
❓ CLI E2E Tests unknown — 90 passed, 0 failed, 1 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #26070889217 |
|
✅ No documentation update needed. docs_optional → No triggered signals (signal_count = 0). This PR fixes a bug where the Aspire dashboard startup URL was not logged when running with non-BrowserToken auth modes. The change makes |
Description
This PR ensures startup logs always include dashboard access details, regardless of frontend auth mode.
Previously, dashboard URL logging was gated on
FrontendAuthMode.BrowserToken, so standalone/non-token scenarios could start successfully without printing a usable dashboard URL.This change introduces a unified startup summary log and updates call sites/tests accordingly.
Fixes #16095
What changed
1) Replaced token-only URL logging with a unified summary helper
LoggingHelpers.WriteDashboardUrl(...)with:LoggingHelpers.WriteDashboardSummary(ILogger logger, string? dashboardUrls, string? otlpGrpcUrls, string? otlpHttpUrls, string? token, bool isContainer = false)Login URLonly when a token is presentisContainer == trueDashboardUrl,LoginUrl,OtlpGrpcUrl,OtlpHttpUrl) for testability/querying2) Dashboard startup logging now always emits summary
In
DashboardWebApplication:WriteDashboardSummary(...)DOTNET_RUNNING_IN_CONTAINER)3) AppHost dashboard event handler also uses summary logging
In
DashboardEventHandlers:WriteDashboardUrl(...)call with unconditionalWriteDashboardSummary(...)Now listening on: ...for readiness/parsing compatibility, then logs summary4) Reduced AI disabled log noise
In
AIContextProvider:"AI is disabled in configuration."LogInformationtoLogDebugThis keeps default/expected disabled state out of normal information-level startup output.
Test updates
LoginUrlproperty.LoggingHelpersTestscovering:Checklist