Skip to content

Fix aspire run failing when DisableDashboard is true#16773

Merged
JamesNK merged 2 commits into
mainfrom
fix/aspire-run-disable-dashboard
May 6, 2026
Merged

Fix aspire run failing when DisableDashboard is true#16773
JamesNK merged 2 commits into
mainfrom
fix/aspire-run-disable-dashboard

Conversation

@JamesNK
Copy link
Copy Markdown
Member

@JamesNK JamesNK commented May 5, 2026

Description

When DisableDashboard = true is set in an app host, aspire run would fail with a DashboardFailure exit code while aspire start succeeded. This PR fixes the inconsistency so both commands work when the dashboard is disabled.

Two changes:

  1. AppHostRpcTarget (src/Aspire.Hosting): Return DashboardUrlsState with DashboardHealthy = false instead of throwing InvalidOperationException when the dashboard is disabled. Also downgraded the log level from Error to Debug since this is an expected configuration.
  2. RunCommand (src/Aspire.Cli): Treat an unhealthy dashboard as a warning instead of a fatal error, allowing the app host to continue running without the dashboard. The dashboard URL shows as "N/A" in the summary output.

Fixes #16619

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
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

When DisableDashboard = true, aspire run would exit with a DashboardFailure
error while aspire start succeeded. Two changes:

1. AppHostRpcTarget: Return DashboardUrlsState with DashboardHealthy=false
   instead of throwing InvalidOperationException when the dashboard is disabled.
2. RunCommand: Treat an unhealthy dashboard as a warning instead of a fatal
   error, allowing the app host to continue running without the dashboard.

Fixes #16619
Copilot AI review requested due to automatic review settings May 5, 2026 08:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

🚀 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 -- 16773

Or

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

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 fixes an inconsistency where aspire run failed when an AppHost disables the dashboard (DisableDashboard = true), while aspire start succeeded. It adjusts both the AppHost backchannel behavior and the CLI’s handling so running without a dashboard is treated as a supported configuration.

Changes:

  • AppHost backchannel now returns an unhealthy DashboardUrlsState (instead of throwing) when the dashboard is disabled.
  • aspire run no longer treats an unhealthy dashboard as fatal; it emits a warning and continues, showing “N/A” for the dashboard URL.
  • Updated CLI string resources and adjusted the related unit test to expect success.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Aspire.Cli.Tests/Commands/RunCommandTests.cs Updates test to validate run succeeds when the dashboard is unhealthy/disabled.
src/Aspire.Hosting/Backchannel/AppHostRpcTarget.cs Returns DashboardUrlsState with DashboardHealthy=false instead of throwing when dashboard is disabled.
src/Aspire.Cli/Commands/RunCommand.cs Downgrades unhealthy dashboard from fatal error/exit code to a warning and continues.
src/Aspire.Cli/Resources/RunCommandStrings.resx Updates the user-facing message to include the “disabled” case.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.zh-Hant.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.zh-Hans.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.tr.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.ru.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.pt-BR.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.pl.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.ko.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.ja.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.it.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.fr.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.es.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.de.xlf Updates localized source string; marks translation for review.
src/Aspire.Cli/Resources/xlf/RunCommandStrings.cs.xlf Updates localized source string; marks translation for review.

Comment thread src/Aspire.Cli/Commands/RunCommand.cs
Comment thread tests/Aspire.Cli.Tests/Commands/RunCommandTests.cs
@JamesNK
Copy link
Copy Markdown
Member Author

JamesNK commented May 6, 2026

image

@JamesNK JamesNK enabled auto-merge (squash) May 6, 2026 07:02
@JamesNK JamesNK merged commit 797c371 into main May 6, 2026
559 of 573 checks passed
@github-actions github-actions Bot added this to the 13.4 milestone May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🎬 CLI E2E Test Recordings — 77 recordings uploaded (commit 8ae4bec)

View all recordings
Status Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireInitSingleFileAppHostRunsViaDotnetRunAppHost ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
Banner_NotDisplayedWithNoLogoFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunEmptyAppHostProject ▶️ View Recording
CreateAndRunJavaEmptyAppHostProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateJavaAppHostWithViteApp ▶️ View Recording
CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain ▶️ View Recording
DashboardRunWithOtelTracesReturnsNoTraces ▶️ View Recording
DeployK8sBasicApiService ▶️ View Recording
DeployK8sWithGarnet ▶️ View Recording
DeployK8sWithMongoDB ▶️ View Recording
DeployK8sWithMySql ▶️ View Recording
DeployK8sWithPostgres ▶️ View Recording
DeployK8sWithRabbitMQ ▶️ View Recording
DeployK8sWithRedis ▶️ View Recording
DeployK8sWithSqlServer ▶️ View Recording
DeployK8sWithValkey ▶️ View Recording
DeployTypeScriptAppToKubernetes ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance ▶️ View Recording
DoListStepsShowsPipelineSteps ▶️ View Recording
DocsCommand_RendersInteractiveMarkdownFromLocalSource ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InitTypeScriptAppHost_AugmentsExistingViteRepoAtRoot ▶️ View Recording
InteractiveCSharpInitCreatesExpectedFiles ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LatestCliCanStartStableChannelAppHost ▶️ View Recording
LatestCliCanStartStableChannelTypeScriptAppHost ▶️ View Recording
LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
OtelLogsReturnsStructuredLogsFromStarterAppCore ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
PublishWithConfigureEnvFileUpdatesEnvOutput ▶️ View Recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
PublishWithoutOutputPathUsesAppHostDirectoryDefault ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RestoreGeneratesSdkFiles_WithConfiguredToolchain ▶️ View Recording
RestoreRefreshesGeneratedSdkAfterAddingIntegration ▶️ View Recording
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ▶️ View Recording
RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
UnAwaitedChainsCompileWithAutoResolvePromises ▶️ View Recording

📹 Recordings uploaded automatically from CI run #25421239338

@aspire-repo-bot
Copy link
Copy Markdown
Contributor

No documentation PR is required for this change.

This PR is a bug fix that corrects an inconsistency where aspire run failed with a DashboardFailure exit code when DisableDashboard = true, while aspire start succeeded. The fix makes both commands behave consistently — the existing behavior of supporting DisableDashboard was already documented, and this PR simply makes aspire run respect it correctly.

  • No new public APIs were added
  • No new configuration options or commands were introduced
  • No user-facing behavior changes (the dashboard URL shows as "N/A" in summary output, which is expected/intuitive)
  • The PR author also indicated docs updates are not required

Generated by PR Documentation Check for issue #16773 · ● 105.5K ·

@davidfowl
Copy link
Copy Markdown
Contributor

@adamint we should verify this in the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[13.3] aspire run and aspire start behave differently if DisableDashboard = true

4 participants