[release/9.1] Resolve DistributedApplicationResourceBuilder<ResourceWithConnectionStringSurrogate> correctly in args evaluation #7727
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.
Backport of #7716 to release/9.1
/cc @mitchdenny @adamint
Customer Impact
Currently in .NET Aspire we have had inconsistent handling of secret parameters depending on whether it is a connection string or a regular secret parameter. This manifested in the
WithArgs(...)
extension method incorrectly rendering connection string args as the type name of the resource builder. This was exposed by a recent improvement to the dashboard where we suppress display of secrets.This PR fixes the underlying issue with secret connection string resources being used as arguments to resources (this was not a regression, but an existing issue that became more obvious with the dashboard improvements).
Testing
Manual testing and added unit tests.
Risk
Low. This wasn't working previously anyway - code change is very targeted.
Regression?