You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show unresolved parameters in resource state - #18896
Resources that reference unresolved parameters previously remained in the Starting state while launch configuration waited for parameter values. This made it difficult to distinguish parameter blocking from ordinary startup and did not identify which values were required.
This change introduces an UnresolvedParameters resource state and publishes the unresolved parameter names as resource metadata. The list updates as values are supplied, then the resource returns to Starting while normal startup completes. Dashboard state details show the parameter names, and late parameter completions cannot overwrite a newer running or terminal state.
User-facing usage
When a resource is blocked by missing parameter values, the dashboard now displays Unresolved parameters with warning styling. Its state details identify the required values, for example:
Waiting for parameters: first, second
The detail list shrinks as parameters resolve and is removed once startup can continue.
Known limitation
The UnresolvedParameters state is inferred from recorded parameter reference relationships and inspectable value expressions, not by observing every parameter read at runtime. A parameter used only inside an opaque environment-variable or argument callback, with no recorded reference or inspectable value expression, is not detected by this state-reporting mechanism.
Launch configuration still waits for the parameter value, but the resource may remain in Starting (or Waiting if it also has resource dependencies) instead of displaying UnresolvedParameters and the missing parameter name. Launch callbacks are deliberately not executed early just to discover these references, preserving their startup ordering and avoiding duplicate side effects.
This dependency discovery executes environment/argument callbacks before BeforeResourceStartedEvent is published below. That reverses the lifecycle contract covered by DcpExecutorTests.EnvironmentCallbacksInvokedAfterBeforeResourceStartEvent: callbacks may depend on state initialized by that event, so enabling this feature can hang startup or compute the wrong dependencies whenever any parameter is unresolved. Reuse dependency data captured during parameter initialization, or defer discovery until after the event while accounting for the existing Waiting transition.
var dependencies = await context.Resource.GetResourceDependenciesAsync(
_executionContext,
ResourceDependencyDiscoveryMode.DirectOnly,
context.CancellationToken).ConfigureAwait(false);
Using Task.IsCompleted does not match the processor's definition of unresolved. DeleteParameterCoreAsync re-adds a cleared parameter to _unresolvedParameters and sets the global flag, but assigns it a completed faulted TCS; therefore a dependent resource started after clearing the value is omitted from this list and never shows UnresolvedParameters. Query unresolved membership from ParameterProcessor rather than inferring it from task completion, and cover the clear-then-start path.
var unresolvedParameters = dependencies
.OfType<ParameterResource>()
.Where(static parameter => parameter.WaitForValueTcs?.Task.IsCompleted is false)
.OrderBy(static parameter => parameter.Name, StringComparers.ResourceName)
UnresolvedParameters replaces Starting, but the lifecycle command state machine does not recognize it. In this state the start command becomes hidden and stop/restart become enabled, whereas Starting makes start/restart disabled and stop hidden (CommandsConfigurationExtensions.cs:33-46,66-79,106-116). Add this state to those classifiers and their ResourceCommandAnnotationTests cases so displaying the blocker does not change available operations.
return snapshot with
{
State = new(KnownResourceStates.UnresolvedParameters, KnownResourceStateStyles.Warn),
Properties = snapshot.Properties.SetResourceProperty(KnownProperties.Resource.UnresolvedParameters, parameterNames)
Dependency discovery can block before the unresolved state is published. For example, the supported external-service environment callback in ResourceBuilderExtensions.cs:439-452 awaits UrlParameter.GetValueAsync() before adding the parameter to the callback result. When that URL parameter is missing, this await never returns, so OnResourceStarting remains here and the resource still appears as Starting. Track these parameter references statically (or use a discovery path that does not await runtime value resolution) and add coverage for a parameterized external-service reference.
var dependencies = await context.Resource.GetResourceDependenciesAsync(
_executionContext,
ResourceDependencyDiscoveryMode.DirectOnly,
context.CancellationToken).ConfigureAwait(false);
Separate startup-blocker tracking from interactive prompting and cover non-interactive deletion and prompt recovery. Keep Stress parameters unset at startup for runtime restart validation.
Co-authored-by: Copilot <[email protected]>
Reuse recursive value-provider discovery for the connection-string-builder environment overload. Cover nested and referenced-only parameters, partial resolution, and relationship preservation, and document the delegated relationship tracking.
Co-authored-by: Copilot <[email protected]>
Cancel only private monitor waits when pending or missing-value generations are replaced, and detach value-change observers on completion. Preserve shared startup tasks and valid monitors across successful reassignment or ordinary failures. Cover repeated replacements, group and instance scopes, stale generations, and callbacks captured before cancellation.
Co-authored-by: Copilot <[email protected]>
Rediscover current connection metadata and expose parameter dependencies held by Keycloak, Entra ID, external-service, and MongoDB callbacks. Centralize startup-state eligibility and report unresolved parameters during custom-resource initialization while preserving per-start and replica behavior. Add regression coverage and a manual Stress scenario.
Co-authored-by: Copilot <[email protected]>
Preserve endpoint owner relationships without traversing their connection metadata during configuration or startup parameter discovery. Retain credential tracking when connection strings are explicitly consumed. Add regression coverage for endpoint properties, expressions, late metadata, dependency force-start, and publish placeholders.
Co-authored-by: Copilot <[email protected]>
Publish model snapshots before parameter initialization so referenced-only parameters cannot claim IDs owned by model resources. Preserve parameter value processing and resource initialization ordering, with coverage for resolved and unresolved values.
Co-authored-by: Copilot <[email protected]>
Title: Show unresolved parameters in resource state
Head Commit:6ad11db58fef45c706beceb1c0baf3b61e4b4781
Tested At: 2026-10-19, 13:43–14:33 UTC (Windows, local mode, isolated AppHosts via aspire start --isolated)
Artifact Version Verification
Build
Used for
aspire --version (installed PR binary)
Expected commit
Status
A
S1, S2, S3
17.0.0-pr.18896.ga0839e64
a0839e64… (PR head when installed)
✅ Verified
B
H2
17.0.0-pr.18896.g6ad11db5
6ad11db5… (current PR head)
✅ Verified
The Build B MCP server also reported aspire-mcp-server 17.0.0-pr.18896.g6ad11db5.
The PR head moved during testing. It was force-pushed (rebase) at 13:39:13 UTC: a0839e64 → 6ad11db5. Each head's own change set was compared (git diff -U0 against its own merge-base, index and @@ lines stripped; 27 commits each) and is byte-identical (MD5 7606DAC6B36FCBE425C5D14A2EAA34E3, 0 differing +/- lines), so only the base changed. The combined scenario (H2) was re-run on Build B so the results also cover the current head.
Changes Analyzed
59 files, +4240/−271, 27 commits.
Files Changed
Hosting (src/Aspire.Hosting)
KnownResourceStates - new UnresolvedParameters state (warning style) plus WaitingStates.
ResourceNotificationService / KnownProperties - startup-blocker state and the unresolvedParameters resource property.
ApplicationOrchestrator (+339) - discovers the parameters a resource depends on and publishes/monitors the state.
ResourceBuilderExtensions / ResourceReferenceDiscoveryAnnotation - record parameter usage from WithEnvironment, WithArgs, WithReference and connection properties.
ParameterProcessor / ParameterResource - re-flag consumers when a parameter becomes unresolved again.
Dashboard: new known state, state view model and tooltip ("Waiting for parameters: …"), localized strings (resx + 13 xlf).
CLI:McpToolHelpers.MapResourceState allow-list.
Playground / tests: Stress AppHost; about 25 test files (mostly ApplicationOrchestratorTests and WithReferenceTests).
Change Categories
CLI changes detected (MCP state mapping)
Hosting integration changes
Dashboard changes
Template changes
Client/Component changes
CI infrastructure changes
VS Code extension changes
Test changes
Test Scenarios Executed
Fixtures were created with aspire new aspire-starter from the PR hive and edited to add parameters. "Unset" parameters had no value; all values used were dummy test values.
Scenario S1: Blocked → unblocked, dashboard, rebuild/delete/restart (Build A)
Objective: Consumers of unset parameters show UnresolvedParameters with the right list instead of looking like they are starting, and recover as parameters are set. Coverage Type: Happy path + unhappy path Status: ✅ Passed
Steps:
apiservice consumed two unset parameters (api-key, db-password); webfrontend consumed one (region) and used WaitFor(apiservice).
aspire describe: both consumers UnresolvedParameters with the correct lists; webfrontend kept waitingFor=[apiservice].
aspire resource <param> set-parameter: the list shrank one name at a time. apiservice launched when its last parameter was set while webfrontend stayed UnresolvedParameters [region]. webfrontend reached Running about 0.2 s after region was set.
Unhappy: aspire resource webfrontend rebuild while blocked - exit 0 in about 2 s, state unchanged, new message logged ("Resource will start with the updated binary when startup blockers are resolved").
Unhappy: delete-parameter db-password while apiservice was Running - it stayed Running and the parameter went to ValueMissing. restart apiservice re-flagged it UnresolvedParameters [db-password]; set-parameter recovered it.
Unhappy: aspire resource apiservice start while blocked - see Finding 1.
Expected Unhappy-Path Outcome: blocked resources stay blocked (no state change on rebuild); deleted parameters only affect the next launch; recovery by setting the parameter. All observed.
Scenario S2: Late-bound properties, ExternalService, opaque callback, MCP (Build A)
Initial: apiservice[api-key, cs-password, db-password, ext-url]; webfrontend[late-prop, region] (late-bound connection property discovered); ext (ExternalService) [ext-url]. opaque-value, used only inside an environment callback, is not listed (documented limitation, Finding 3).
A: after webfrontend's own parameters were set, it moved from UnresolvedParameters to Waiting (on apiservice).
B: delete-parameter region while webfrontend was Waiting re-flagged it UnresolvedParameters [region] (and kept waitingFor); setting it again returned to Waiting.
C (unhappy): set-parameter api-key --value '' was rejected (--value: Value is required., exit 16); state unchanged.
D/E: the list shrank per set-parameter; apiservice sat in Starting with an empty list until opaque-value was set, then all 5 resources were Running/Healthy and the secret argument was masked.
F (unhappy): with everything Running, ext-url=not-a-url left Running resources untouched. restart apiservice then gave FailedToStart ("The URL for the external service must be an absolute URI") while webfrontend stayed Running.
G: a valid ext-url plus aspire resource apiservice start recovered apiservice to Running/Healthy.
Expected Unhappy-Path Outcome: validation error with non-zero exit; safe FailedToStart that does not disturb other resources; recoverable by fixing the parameter. All observed.
Scenario S3: In-process state trace (Build A)
Objective: Confirm exact state transitions with ResourceNotificationService.WatchAsync. Coverage Type: Happy path + boundary Status: ✅ Passed
Observations:
apiservice (resolved parameters only) never reported UnresolvedParameters.
webfrontend went Starting → UnresolvedParameters [pending] within 3 ms; UnresolvedParameters won over Waiting; resolved parameters were never listed; only rebuild was enabled while blocked.
Setting pending gave Running/Healthy in about 0.2 s.
Evidence:s3-state-trace.log, s3-step-unblock.txt
Scenario H2: Combined re-run on the rebased head (Build B)
Objective: Re-verify every behavior above on the build from the current head. Coverage Type: Happy path + unhappy path + boundary Status: ✅ Passed
Fixture: 3 resolved and 7 unset parameters, connection strings appdb and late-source, ExternalService ext, apiservice (resolved-only consumer), webfrontend (heavy consumer plus an opaque env callback), and an in-process notification trace.
Steps and observations:
Blocked state matched Build A: webfrontendUnresolvedParameters [api-key, cs-password, db-password, ext-url, late-prop, region] (opaque-value not listed, rebuild the only command); ext[ext-url]; apiservice Running throughout; appdbWaiting [cs-password].
Dashboard: banner, warning icons, "Waiting for parameters: …" row text, Start disabled, actions menu with Start/Restart disabled and Rebuild enabled; secret values masked.
MCP (blocked): webfrontend and ext report state: UnresolvedParameters, state_style: warning. wait_for_resources (8 s) returned outcome: timeout; apiservice succeeded and webfrontend reported "Timed out waiting for the target state."
Unblock: the list shrank one name per set-parameter; appdb went Waiting → Running on cs-password; ext went Running on a valid ext-url; webfrontend went to Starting with an empty list while opaque-value was unset; setting it made everything Running/Healthy. A parallel MCP wait_for_resources (healthy) returned outcome: success after about 41 s.
Unhappy: delete-parameter region while webfrontend was Running left it Running (region → ValueMissing). restart webfrontend went Stopping → Finished → Starting → UnresolvedParameters [region] in about 0.7 s. The restart command blocked until the gate opened and returned exit 0 after 179 s, once region was set from another shell.
Unhappy: rebuild webfrontend while blocked - exit 0 in 3 s, state unchanged, still rebuild-only.
Recovery: set-parameter region returned all resources to Running/Healthy; the dashboard showed all resources Running with no banner.
Trace analysis (145 rows): 0 apiservice rows with UnresolvedParameters; 0 rows listing a resolved parameter; 0 rows with a non-empty list but a different state; 0 UnresolvedParameters rows with an empty list; 4 rows carrying both UnresolvedParameters and waitingFor (priority UnresolvedParameters > Waiting confirmed).
ext showed Waiting for about 29 ms before UnresolvedParameters; ExternalServiceBuilderExtensions already created it with an initial Waiting state on main.
Forced start while blocked (Low).Start is disabled in the dashboard and not offered by describe, but aspire resource <name> start is still accepted while a resource is UnresolvedParameters: the command blocks until the parameters are resolved. In S1, when the last parameter was set, apiservice went Starting → Stopping → Starting → Waiting → Starting → Running (about 1.2 s) while a normal unblock of webfrontend in the same run was clean (Starting → Running). From reading the code, ResourceCommandService does not enforce the enabled state, so this looks pre-existing, but it was not baseline-compared and was observed on Build A only.
MCP exposes the state, not the names (enhancement).list_resources reports UnresolvedParameters but waiting_for stays [], so an agent cannot tell which parameters to ask for. The names are available through aspire describe and the dashboard.
Parameters used only inside opaque callbacks are not listed (documented in the PR). Confirmed on both builds: the resource stays Starting with an empty list. Launch is still gated on the parameter value, so nothing starts early; it is just not labeled.
Rebuild log wording (nit). While blocked, the build log prints "Stopping resource for rebuild..." and "Build succeeded. Restarting resource..." before "Resource will start with the updated binary when startup blockers are resolved", although nothing is stopped or restarted.
FYI (no action):appdb (connection string with an unset parameter) shows Waiting [param] rather than UnresolvedParameters - it comes from the existing WaitForStart on connection strings; the restart/start CLI commands block until the launch gate opens; short transients on start (a blank state between Starting and Running, a ~1.6 s Unhealthy → Healthy blip) were seen but not baseline-compared.
Not Covered / Limitations
The Docker engine was not running, so container-backed scenarios (Keycloak admin password, MongoDB WithKeyFile) were not run; EntraId needs Azure. Those integration changes were not exercised end to end. The PR's own unit tests were not run locally.
Windows only; no baseline (main) CLI comparison.
The empty-value rejection, the invalid-ExternalService-URL recovery and the forced-start observation were exercised on Build A only. The PR's own diff is byte-identical across the rebase.
No dashboard screenshot for S3 (verified through the in-process trace).
✅ PR VERIFIED - no blocking issues found. The UnresolvedParameters state, parameter lists, command states, dashboard presentation, MCP mapping and recovery paths behave as described.
Recommendations
Consider surfacing the unresolved parameter names to MCP clients, since waiting_for is empty in this state.
Decide whether the CLI/MCP start path should honor the disabled Start state while UnresolvedParameters (or document that it queues until resolved), and compare the transient Stopping blip against main.
Consider adjusting the rebuild log wording while a resource is blocked.
Evidence
Captured locally (screenshots cannot be attached through gh pr comment): 13 dashboard screenshots (Build A S1/S2, Build B H2) and the logs referenced above.
Observe startup state changes and retire model-scoped monitors after each captured replica finishes its attempt. Cover overridden parameters, restarts, and replica lifetimes.
Co-authored-by: Copilot <[email protected]>
This disables dependency force-start even when the recorded parameter is no longer consumed. For example, .WithEnvironment("VALUE", parameter).WithEnvironment("VALUE", "literal").WaitFor(dependency) retains the parameter reference and reports UnresolvedParameters. If the dependency never becomes ready, Start is now disabled even though launch needs no parameter value. Preserve dependency force-start when resource.waitingFor is present, and update ApplicationOrchestrator.StartResourceAsync to release that existing wait rather than request a second DCP start. Actual parameter reads should still gate launch. Add a regression that force-starts this overridden-parameter case while its dependency remains unready.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Resources that reference unresolved parameters previously remained in the
Startingstate while launch configuration waited for parameter values. This made it difficult to distinguish parameter blocking from ordinary startup and did not identify which values were required.This change introduces an
UnresolvedParametersresource state and publishes the unresolved parameter names as resource metadata. The list updates as values are supplied, then the resource returns toStartingwhile normal startup completes. Dashboard state details show the parameter names, and late parameter completions cannot overwrite a newer running or terminal state.User-facing usage
When a resource is blocked by missing parameter values, the dashboard now displays Unresolved parameters with warning styling. Its state details identify the required values, for example:
The detail list shrinks as parameters resolve and is removed once startup can continue.
Known limitation
The
UnresolvedParametersstate is inferred from recorded parameter reference relationships and inspectable value expressions, not by observing every parameter read at runtime. A parameter used only inside an opaque environment-variable or argument callback, with no recorded reference or inspectable value expression, is not detected by this state-reporting mechanism.Launch configuration still waits for the parameter value, but the resource may remain in
Starting(orWaitingif it also has resource dependencies) instead of displayingUnresolvedParametersand the missing parameter name. Launch callbacks are deliberately not executed early just to discover these references, preserving their startup ordering and avoiding duplicate side effects.Validation:
dotnet test --project tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj --no-launch-profile -- --filter-class "*.ApplicationOrchestratorTests" --filter-class "*.ResourceNotificationTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"(66 passed)dotnet test --project tests/Aspire.Dashboard.Tests/Aspire.Dashboard.Tests.csproj --no-launch-profile -- --filter-class "*.ResourceStateViewModelTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"(21 passed)dotnet build /t:UpdateXlf src/Aspire.Dashboard/Aspire.Dashboard.csprojNo existing issue was found that directly tracks dependent resources remaining in
Startingwhile waiting for unresolved parameters.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?