Repository navigation
Project Radius backing resource connections from recipe outputs - #19031
Nell Shamrell-Harrington (nellshamrell) wants to merge 7 commits into
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19031Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19031" |
There was a problem hiding this comment.
Pull request overview
Routes Radius backing-resource connections through recipe outputs instead of invalid Aspire-derived endpoints.
Changes:
- Projects host, port, username, and credentials from Radius resources.
- Adds focused diagnostics, URI escaping, and a public cross-environment exception.
- Expands unit and snapshot coverage across supported backing resources.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/Aspire.Hosting.Radius.Tests/Snapshots/LegacyFallbackEmissionTests.UdtOnly_DoesNotEmitLegacyParents.verified.bicep |
Captures UDT recipe credentials. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/LegacyFallbackEmissionTests.MixedLegacyAndUdt_EmitsBothParentPairs.verified.bicep |
Captures mixed resource credentials. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/LegacyFallbackEmissionTests.LegacyAndUdt_ShareResourceNameAndUseDistinctParents.verified.bicep |
Verifies distinct parent wiring. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/BackingResourceValueResolutionTests.UserNameParameter_IsProjectedFromRecipeOutputs.verified.bicep |
Verifies projected usernames. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/BackingResourceProjectionTests.LegacyBackingResource_DoesNotLeakAspireGeneratedPasswordParameter.verified.bicep |
Verifies secret replacement. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/BackingResourceProjectionTests.DirectEndpointPropertyReference_ProjectsRecipeOutputs.verified.bicep |
Verifies direct endpoint projection. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/BackingResourceProjectionTests.CallbackRenamingBackingResource_RewiresProjectedEnvironmentValues.verified.bicep |
Verifies callback rewiring. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/BackingResourceProjectionTests.AllBackingResourceTypes_ProjectRecipeOutputs.verified.bicep |
Covers all mapped backing types. |
tests/Aspire.Hosting.Radius.Tests/RecordingLogger.cs |
Adds diagnostic log capture. |
tests/Aspire.Hosting.Radius.Tests/Publishing/BackingResourceValueResolutionTests.cs |
Tests resolution and warning behavior. |
tests/Aspire.Hosting.Radius.Tests/Publishing/BackingResourceProjectionTests.cs |
Tests projections and failure cases. |
tests/Aspire.Hosting.Radius.Tests/Publishing/BackingResourceContractTests.cs |
Guards mapping/schema invariants. |
src/Aspire.Hosting.Radius/ResourceMapping/ResourceTypeMapper.cs |
Exposes emitted backing-type mappings internally. |
src/Aspire.Hosting.Radius/README.md |
Documents connection projection and diagnostics. |
src/Aspire.Hosting.Radius/RadiusEnvironmentResource.cs |
Rejects unresolved backing endpoints. |
src/Aspire.Hosting.Radius/RadiusBackingResourceEndpointException.cs |
Adds the public endpoint exception. |
src/Aspire.Hosting.Radius/Publishing/RadiusUnresolvableValueException.cs |
Adds an internal skip condition. |
src/Aspire.Hosting.Radius/Publishing/RadiusInfrastructureBuilder.cs |
Implements projection and credential wiring. |
src/Aspire.Hosting.Radius/Publishing/RadiusBackingConnections.cs |
Defines per-type connection schemas. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
e5b5133 to
04925ab
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.
Suppressed comments (5)
src/Aspire.Hosting.Radius/Publishing/RadiusInfrastructureBuilder.cs:983
- Passing the same parameter as both the user name and password of one legacy resource is not rejected because
RegisterRecipeCredentialpermits repeated registration for the same owner. This assignment then overwrites the password substitution, so both fields resolve toproperties.usernameand authentication fails. Track the credential role/accessor and reject one parameter mapping to two distinct recipe outputs, even for the same resource.
WarnIfUserSuppliedCredentialIsReplaced(resource, userNameParameter, "user name");
RegisterRecipeCredential(userNameParameter, resource, isProjectionSubstitution: true);
_recipeSecretSubstitutions[userNameParameter] =
new ProjectedValue(construct, userNameProperty, IsSecret: false, IsNumeric: false);
src/Aspire.Hosting.Radius/README.md:200
- This diagnostic entry describes the unrelated-resource warning, but that warning does not include
ASPIRERADIUS061; the code is only emitted when one parameter is shared by multiple backing-resource credentials. Document both behaviors accurately so users can map this code to the failure they receive.
| `ASPIRERADIUS061` | Publish | A resource references a parameter that is also a backing resource's credential. The recipe generates that credential, so the referencing resource receives the recipe's value rather than the parameter's. |
src/Aspire.Hosting.Radius/Publishing/Constructs/RadiusResourceTypeConstruct.cs:82
- The PR description identifies the exception as the sole new public API, but this change also adds
UserName,Password, andDatabaseas public members on the callback construct. These become supported customization surface. Either include these members in the API review/description or keep them internal and drive them through the existing internal schema-property path.
public BicepValue<object> UserName
{
get { Initialize(); return _userName!; }
set { Initialize(); _userName!.Assign(value); }
src/Aspire.Hosting.Radius/RadiusBackingResourceEndpointException.cs:58
- This public constructor throws when
resourceis null, but its XML documentation omits the exception contract. Document theArgumentNullExceptionso the published API docs match the implementation.
/// <param name="resource">The backing resource whose address could not be determined.</param>
/// <param name="message">The message that describes the error.</param>
public RadiusBackingResourceEndpointException(IResource resource, string message)
src/Aspire.Hosting.Radius/Publishing/RadiusInfrastructureBuilder.cs:1012
- Recipe-input user names are assigned here but are never registered with
RegisterRecipeCredential. If one parameter is used for a legacy MongoDB/RabbitMQ user name and a PostgreSQL/SQL Server user name, the legacy substitution rewrites the UDT consumer to<legacy>.properties.usernamewhile this recipe still receives the original parameter, producing a credential mismatch. Register the resolved user-name parameter as a non-substitution owner too; note that PostgreSQL wraps it in a nestedReferenceExpression, so the current exact-provider helper does not find it.
await SetTypePropertyAsync(construct, "username", withConnectionString, "username").ConfigureAwait(false);
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
04925ab to
fa4e880
Compare
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
fa4e880 to
002863a
Compare
002863a to
8f621b1
Compare
Fixes microsoft#18935. `RadiusEnvironmentResource.GetHostAddressExpression` applied the Radius container recipe's ClusterIP Service rule (`{name}-{name}.<ns>.svc.cluster.local`) to every endpoint resolved for a Radius consumer. Backing resources (Redis, PostgreSQL, MongoDB, SQL Server, RabbitMQ) are provisioned by a Radius *recipe* rather than as a `Radius.Compute/containers` workload, and the recipe names its own Service, so those addresses never resolved. Aspire also composed its own locally-generated password parameters into the connection strings, which the recipes never receive. The blast radius was wider than the issue described: a single `WithReference` emits both `ConnectionStrings__x` and the splatted `X_HOST`/`X_PORT`/ `X_PASSWORD`/`X_URI` connection properties, so guarding only the connection string would have left most of them broken. Substitute at the value-provider level instead, so connection strings, URIs, splatted properties and `services__*` all compose correctly without this package duplicating any connection-string format: * host/port -> `<resource>.properties.host` / `.port`, wrapped in `string(...)` when standalone since the port output is an int and env values are strings. * password on legacy `Applications.*` types -> `<resource>.listSecrets().password`. * password/username/database on `Radius.*` UDTs -> passed into the recipe as `recipe.parameters`, so both sides agree by construction. These are required recipe inputs that were previously never emitted at all. Fail fast rather than emit a silently unreachable value: backing-resource endpoints resolved through the compute-environment helpers, references across Radius environments, types with no host/port output, more than one database on a server resource, and a credential parameter shared with a `listSecrets()` owner. The new exception deliberately does not derive from `InvalidOperationException` so the existing "skip unresolvable endpoint" catch cannot swallow it. Projected values resolve their Bicep identifier lazily and are re-emitted after `ConfigureRadiusInfrastructure` callbacks when a target was renamed, rejected when it was removed, and left alone when the callback set the value itself. Co-authored-by: Copilot <[email protected]> Copilot-Session: 720998b6-ff9f-4ec9-9ad9-460909f7a186
Fixes the findings from the code-review, hosting-integration-authoring and architecture reviews of the backing-resource projection change. Error handling. The env-var loop's `catch (InvalidOperationException)` was positional rather than structural: it silently dropped every value produced by an Azure Bicep output, at Debug level, because that is the type `BicepOutputReference.Value` happens to throw. The two conditions the publisher genuinely means to skip -- a value only knowable after another deployment, and a reference to an endpoint the target does not declare -- are now raised as `RadiusUnresolvableValueException` and logged at Warning; everything else fails the publish. Exception contract. `RadiusBackingResourceEndpointException` is now public and lives in `Aspire.Hosting.Radius`, because it reaches authors using the Kubernetes, Container Apps and App Service publishers through the shared endpoint resolver. Its message is written for that audience. Schema table. The `(string? PasswordSecret, bool TakesCredentialRecipeParameters)` pair could express "credential handled by neither mechanism" -- the shape of the bug this change fixes -- so it is replaced by a closed credential mode. Radius types with no verified schema are removed rather than left to project values that may not exist, and a test fails if an emitted type has no entry. Credentials. A user name supplied as a parameter is now projected from the recipe's output like the password already was, so the connection string no longer names a user the recipe never created. Replacing a credential the AppHost author chose is reported, since its value never reaches the cluster. Databases. The multi-database failure is scoped to databases consumers actually reference; a server with no database child publishes with a warning. Recipe inputs are resolved through a substitution-free path so a recipe cannot be fed its own output, and are rebuilt when a `ConfigureRadiusInfrastructure` callback swaps the construct they target. URI escaping. Values a reference expression marked as URI components are emitted as `uriComponent(...)`, so a recipe-generated password containing `@` or `/` cannot corrupt the URI it is placed in. Co-authored-by: Copilot <[email protected]> Copilot-Session: b3bee2e4-d5fd-4325-a4e7-090e4598c5e1
The exception is the one piece of public API this change introduces, and catching it is the whole reason it is public, so show that. Co-authored-by: Copilot <[email protected]> Copilot-Session: b3bee2e4-d5fd-4325-a4e7-090e4598c5e1
Address the second round of review feedback on the Radius backing resource projection: - Credentials for Radius.* resource types are now written to the required top-level schema properties (username/password/database) instead of properties.recipe.parameters. The resource type manifests in radius-project/resource-types-contrib declare these as required properties and the recipes read them via context.resource.properties.<name>, so the previous shape would have failed schema validation at deploy time. - Point Radius.Data/postgreSqlDatabases at ghcr.io/radius-project/kube-recipes/postgresqldatabases:latest. The recipes/local-dev/postgresqldatabases artifact is not published. - Only skip an environment variable when the failing value provider is an IManifestExpressionProvider, so an InvalidOperationException from an arbitrary provider fails the publish instead of silently dropping the variable. - Add a KinD deployment end-to-end test that deploys a Radius Postgres backing resource and verifies the projected connection information. - Fix stale test class and method references in docs, and scope the README credential-replacement warning to legacy Applications.* resources. Co-authored-by: Copilot <[email protected]> Copilot-Session: 62ae7028-e315-4b1d-9d85-e7b58bc1e1f0
rad install kubernetes registers only the built-in namespaces, and the pinned bicep extension does not carry Radius.Data/postgreSqlDatabases, so the resource compiled to a classic ARM resource and the deployment engine routed it to the Azure provider. Register the type with the control plane and import a locally published extension so the type is deployable, then deploy the published artifacts directly and assert the password projected into the consumer both matches the parameter and authenticates. Co-authored-by: Copilot <[email protected]> Copilot-Session: 62ae7028-e315-4b1d-9d85-e7b58bc1e1f0
- Map SqlServerServerResource to the legacy Applications.Datastores/sqlDatabases type with a listSecrets() projection. Radius.Data/sqlDatabases is not a real UDT (contrib defines Radius.Data/sqlServerDatabases) and its kube recipe is not published, so the emitted type could not resolve at deploy time. - Reject a parameter used as both the user name and the password of one backing resource. Substitutions are keyed by parameter identity, so the later user name assignment silently overwrote the password projection. - Register user-name parameters as recipe credentials on the schema-property path so sharing one with a listSecrets()-substituted resource is caught, and unwrap nested pass-through ReferenceExpressions when extracting a credential parameter (PostgreSQL exposes its user name that way). - Fail the publish when several databases are declared and none is referenced through WithReference, instead of picking the first child; a WithEnvironment callback consumer records no annotation, so the choice cannot be proven. Co-authored-by: Copilot <[email protected]> Copilot-Session: d532fd9b-ea31-4f3e-afa0-2511df99b0ba
The secret-store work that landed on main claimed ASPIRERADIUS061-068, which collided with the 060-065 range this branch used for backing-resource projection. Move the backing-resource codes to the free 069-074 range so each diagnostic still identifies exactly one condition. Co-authored-by: Copilot <[email protected]> Copilot-Session: d532fd9b-ea31-4f3e-afa0-2511df99b0ba
8f621b1 to
88d96d3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
src/Aspire.Hosting.Radius/README.md:303
- This is not a current limitation: the upstream TypeSpec declares
queueas optional, and the default recipe usescontext.resource.namewhen it is omitted. Keeping this bullet incorrectly tells users that generated RabbitMQ resources fail schema validation; please remove it.
* Legacy `Applications.Messaging/rabbitMQQueues` requires a `queue` property that Aspire does not emit, because the Aspire RabbitMQ resource has no queue concept.
| [RadiusResourceTypes.LegacySqlDatabases] = | ||
| new("server", "port", "username", new RadiusCredentialMode.ListSecrets("password")), |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Closing in favor of #19253, opened from an identical branch ( |
Nell Shamrell-Harrington (nellshamrell)
left a comment
There was a problem hiding this comment.
Code review — 7 findings
Reviewed the full change set against the upstream merge base. Important: the pushed PR head (88d96d3f5) is 10 commits behind the branch in the author's fork (3eebff33d), so several findings below refer to code that only exists locally and could not be anchored as inline comments. All 590 Aspire.Hosting.Radius.Tests pass locally on the newer commit.
Categories: 1 process/blocking, 2 test-infrastructure, 1 correctness, 1 API-review, 2 docs/convention.
1. The PR head is 10 commits stale — the pushed diff is not what would be merged (blocking for review)
PR head is 88d96d3f5; the branch is at 3eebff33d. The pushed version still contains RadiusBackingResourceEndpointException (renamed to RadiusBackingResourceProjectionException locally), the old WarnOnUnrelatedUsesOfSubstitutedParameters double-negation, and none of the ASPIRERADIUS075–ASPIRERADIUS090 diagnostics. Please push 3eebff33d before further review — inline comments can only anchor to lines present in the pushed diff.
2. Two new heavyweight KinD deployment E2E tests run on every PR as plain [Fact]
RadiusDeployTests.DeployRadiusPostgresBackingResourceToKind and (in the newer commits) DeployRadiusRedisRabbitMqAndMongoBackingResourcesToKind each create a KinD cluster, install the Radius control plane, run aspire deploy with a 20-minute budget, two 6-minute kubectl waits, and 8-minute retry loops. Together with the pre-existing DeployRadiusContainerToKind that is three full KinD + Radius control-plane installs per PR run of the CLI E2E suite — worst case well over an hour of wall clock and three new flake surfaces (image pulls, control-plane install, recipe pulls from ghcr).
The coverage itself is genuinely good and worth keeping; the concern is only the per-PR budget. Consider [OuterloopTest] for at least the multi-resource test, or consolidating the three into a single cluster lifecycle.
3. Radius v0.59 → v0.60 is a silent breaking change with no release note
README.md now requires Radius v0.60+ and documents that v0.59 fails silently: v0.60 renamed the Radius.Core/recipePacks fields recipeKind/recipeLocation to kind/source, and the Radius API server drops unrecognized fields rather than rejecting them, so a v0.59 cluster produces an empty recipe pack with no error and every backing resource then fails to resolve a recipe.
Anyone already on v0.59 who takes this package upgrade gets a deploy that reports success and produces a non-functional app. The README explains it well, but there is no breaking-change entry or release note accompanying the change, and nothing in the emitted artifacts detects or asserts the control-plane version.
4. The RabbitMQ guest guard only catches the literal default
In RadiusInfrastructureBuilder.ApplyRecipeInputPropertyCredentialsAsync (local RadiusInfrastructureBuilder.cs:2373-2374):
if (construct.GetSchemaProperty("username") is { } emittedUserName &&
RenderBicepValue(emittedUserName) is "'guest'")RenderBicepValue returns a quoted Bicep string literal only when the user name was a literal. AddRabbitMQ("q", userName: builder.AddParameter("u")) renders as a Bicep identifier (u), so a parameter whose value happens to be guest sails through the guard and provisions a broker that RabbitMQ restricts to loopback — no workload can authenticate against it, which is exactly the failure ASPIRERADIUS082 exists to prevent.
Note that supplying a parameter is precisely the remediation the ASPIRERADIUS082 message recommends, so the guidance routes users around the guard. Parameter values are generally resolvable at publish time; consider resolving the parameter's value before comparing, so both spellings are covered.
5. New public API added without API review
RadiusBackingResourceEndpointException / RadiusBackingResourceProjectionException is a new public type on a shipping surface, and the PR checklist answers "No" to API review. Worth an explicit API review sign-off before merge, especially since the type was renamed after the pushed head — the PR description still names the old type.
6. Assert.DoesNotContain in the new deployment E2E assertions (newer commits)
tests/Aspire.Cli.EndToEnd.Tests/RadiusDeployTests.cs (local lines 624-625, 632) asserts the legacy Redis/RabbitMQ/Mongo type strings are absent from the generated Bicep. The repository test guidelines explicitly discourage Assert.DoesNotContain as a weak assertion that easily goes out of date. The positive assertions two lines above (Assert.Contains("Radius.Data/redisCaches", ...), Assert.Contains("Radius.Messaging/rabbitMQ@", ...)) already establish the emitted type, making these redundant — prefer asserting the complete emitted type set instead.
7. Stale class-level documentation in RadiusDeployTests
The class summary states "A public image (mcr.microsoft.com/dotnet/samples:aspnetapp) is used so the KinD node pulls it directly from MCR", but ContainerImage is mcr.microsoft.com/azuredocs/aci-helloworld. Pre-existing, but this PR adds two more tests that inherit that documentation, so it is a good opportunity to correct it.
Verified and cleared (no action needed)
- The Redis
NoCredentialpath emits'${cache.properties.host}:${cache.properties.port},password='. Confirmed empirically thatStackExchange.Redis.ConfigurationOptions.Parsenormalizes the empty password away entirely (round-trips tohost:6379), so noAUTHis attempted against the unauthenticated recipe-deployed server. - The
ASPIRERADIUS071hard failure for an emitted backing type with no schema row is correctly justified and pinned byEveryEmittedBackingType_HasAConnectionSchema. EnvPart.WithStringFormat/ApplyStringFormatstay in sync withAspire.Hosting.Utils.FormattingHelpers.FormatValue(bothuri-only, both case-insensitive).- Narrowing
catch (InvalidOperationException)toRadiusUnresolvableValueExceptionis correctly gated on a positiveIManifestExpressionProvidermarker with a cycle-safe, fail-closed walk. - Deployment E2E coverage genuinely authenticates against the deployed servers rather than asserting on generated Bicep:
psql -tAc 'select 1'for PostgreSQL,rabbitmqctl authenticate_userfor RabbitMQ,mongosh --authenticationDatabase adminfor MongoDB, andredis-cli pingto prove Redis is unauthenticated. This is the right shape for the change.
|
Retracting my earlier review on this PR — I posted it here by mistake. This PR is closed and superseded; the live PR for this work is #19555, where the review has been reposted against the current head. The two inline comments have been deleted. The review body above cannot be removed via the API on a submitted review, so please disregard it — in particular its first finding, which misdiagnosed a stale head that was simply the result of this PR being closed while the branch continued to move. |
Description
An Aspire app deployed to Radius could not talk to its own cache, database, or queue. Every connection value the app received was wrong, so
WithReferenceproduced a connection string that pointed nowhere and the app failed at startup.The cause is that a "backing" resource targeted at a Radius environment — Redis, PostgreSQL, MongoDB, SQL Server, RabbitMQ — is not deployed as a
Radius.Compute/containersworkload. It is provisioned by a Radius recipe. The recipe, not Aspire, decides the KubernetesServicename and generates the credentials. Aspire was still deriving the host, port, and password from its own endpoint model, so it emitted a container-shaped address likecache-cache.default.svc.cluster.localfor a Service the recipe had named something else, paired with a password the recipe never issued.User-facing behavior
Referencing a backing resource now works. Every value a consumer sees is projected from that resource's own Radius outputs:
ConnectionStrings__*,*_HOST,*_PORT,*_URI, service discovery)<resource>.properties.host/<resource>.properties.portApplications.*types (Redis, MongoDB, RabbitMQ, SQL Server)<resource>.listSecrets().password<resource>.properties.usernameRadius.*types (PostgreSQL)username/passwordschema properties, using the same secure Bicep parameter Aspire composes into the connection string, so both sides agree by constructionBecause the substitution happens on the underlying values rather than on formatted strings, connection strings, URIs, and the individual properties emitted by
WithReferenceall resolve consistently.Three failures that were previously silent are now reported:
ASPIRERADIUS069instead of emitting an unroutable address. This also surfaces from the Kubernetes, Azure Container Apps, and Azure App Service publishers, which resolve such references through the owning Radius environment.User-facing usage
No API change is required — this is what an existing AppHost already looks like, and it now deploys correctly:
aspire publishnow emits, for the container:pg_passwordis the secure parameter Aspire also passes into the recipe, so the value the app receives and the value the recipe provisions are the same by construction. Where the same credential appears inside a URI it is escaped:The one new public API is the exception, so that a cross-environment reference can be caught by name:
Implementation notes
RadiusBackingConnectionsholds the type → connection-schema table. Its credential mode is a closed hierarchy (ListSecrets/RecipeInputProperties/NotProjected) so "credential handled by neither mechanism" — the exact shape of this bug — is unrepresentable, and a contract test fails if a newly mapped backing type has no schema entry.InvalidOperationExceptionbroadly. That was positional rather than structural; it is now narrowed to the conditions the publisher genuinely intends to skip, raised as an internalRadiusUnresolvableValueException. A value is only skipped when it is anIManifestExpressionProvider(a positive marker for "produced by another deployment") and it fails to resolve; anInvalidOperationExceptionfrom any other value provider now fails the publish rather than silently dropping the variable.Radius.*types are written to the resource type's top-level schema properties rather thanproperties.recipe.parameters. The manifests inradius-project/resource-types-contribdeclareusername/passwordas required properties and the recipes read them ascontext.resource.properties.<name>, so the recipe-parameter shape would have failed schema validation at deploy time.Radius.Data/postgreSqlDatabasesisghcr.io/radius-project/kube-recipes/postgresqldatabases:latest. Therecipes/local-dev/postgresqldatabasesartifact this originally pointed at is not published.ReferenceExpressionmarked as URI components are emitted as BicepuriComponent(...), so a recipe-generated password containing@or/cannot corrupt the URI it sits in.WithEnvironmentcallback records no reference annotation, so the choice cannot be proven.Applications.Datastores/sqlDatabasestype. The contrib UDT isRadius.Data/sqlServerDatabases(notsqlDatabases), and its Kubernetes recipe is not published —ghcr.io/radius-project/kube-recipes/sqlserverdatabases:latestreturns 403 — so the legacy type, which has both a published recipe and alistSecrets()action, is the only deployable option today.ASPIRERADIUS070. Substitutions are keyed by parameter identity, so such a parameter could only ever be rewritten to one of the two values.ASPIRERADIUS069–074, documented insrc/Aspire.Hosting.Radius/README.mdalong with three known gaps (default MongoDB/RabbitMQ user names cannot be projected, legacyrabbitMQQueuesneeds aqueueproperty Aspire has no concept of, anduriComponentescaping differs cosmetically fromUri.EscapeDataString).Validation
Aspire.Hosting.Radius.Tests: 500 passing, 0 failing (the count includes the secret-store tests that landed onmainwhile this branch was open). The new tests cover schema totality, the cross-publisher exception contract, the narrowed-catch conditions (both the skip and the fail-the-publish path), user-name projection, database scoping, the credential warnings, and URI escaping.DeployRadiusPostgresBackingResourceToKind, stands up KinD plus the Radius control plane, publishes an AppHost that references a Postgres backing resource, deploys the generated artifacts, and then reads the environment back off the deployed container and authenticates against the provisioned database withpsql. This is what surfaced the property-shape and recipe-source bugs above, which the Bicep snapshots could not catch.rad install kubernetesregisters only the built-in namespaces, and the Bicep extensionradresolves (br:biceptypes.azurecr.io/radius:<version>) does not carryRadius.Data/postgreSqlDatabases. The resource therefore compiles to a classic ARM resource (BCP081) and the deployment engine routes it to the Azure provider, failing with "Azure deployment failed, please ensure you have configured an Azure provider". The type has to be registered with the control plane (rad resource-type create) and published as a local Bicep extension (rad bicep publish-extension) that the app imports. The test does both, and the README now documents the sequence.Aspire.Hosting.Kubernetes.Tests269/269,Aspire.Hosting.Azure.Kubernetes.Tests63/63,Aspire.Hosting.Azure.Tests1645 passed / 5 skipped../build.shclean with 0 warnings.AutoVerifylocally.Security considerations
This change alters how credentials appear in generated deployment artifacts, so it is flagged for review even though the net effect is a reduction in exposure:
listSecrets(), or passed into the recipe as a secure parameter. No secret value is materialized into the generated file in either case.uriComponent(...). Recipe-generated passwords come from an alphabet the recipe chooses rather than Aspire's URL-safe generator, so an unescaped@,/, or:could previously have re-parsed the URI's authority section.Fixes #18935
Checklist
<remarks />and<code />elements on your triple slash comments?