Skip to content

ExternalServiceResource does not work if the parameter value is not set #10352

@davidfowl

Description

@davidfowl

Run the following and it will show up as unknown:

var externalSvc = builder.AddExternalService("svc", builder.AddParameter("url"));

This is because it accesses the parameter's value directly

var url = resource.UrlParameter?.Value;

Which throws if it wasn't provided (or can even throw if there's an error getting the value). We should use IValueProvider.GetValueAsync and we should gracefully propagate errors from the parameter resolution to this resource's state.

cc @DamianEdwards

Metadata

Metadata

Assignees

Labels

area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions