Repository navigation
Project Radius backing resource connections from recipe outputs, and upgrade to Radius 0.60 - #19555
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19555Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19555" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Updates Radius publishing so recipe-backed resources expose correct endpoints and credentials, targeting Radius 0.60.
Changes:
- Projects backing-resource connections from Radius recipe outputs.
- Uses
Radius.Security/secretsand Kubernetes secret references for credentials. - Adds diagnostics, contract tests, snapshots, and KinD deployment coverage.
Reviewed changes
Copilot reviewed 44 out of 45 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Aspire.Hosting.Radius/README.md |
Documents Radius 0.60 behavior and diagnostics. |
src/Aspire.Hosting.Radius/RadiusBackingResourceEndpointException.cs |
Adds the public projection exception. |
src/Aspire.Hosting.Radius/RadiusBicepExtension.cs |
Pins Radius Bicep types to 0.60. |
src/Aspire.Hosting.Radius/RadiusEnvironmentResource.cs |
Guards recipe-owned endpoints and TLS metadata. |
src/Aspire.Hosting.Radius/Publishing/BicepPostProcessor.cs |
Emits and validates security-secret constructs. |
src/Aspire.Hosting.Radius/Publishing/Constructs/ContainerEnvVarConstruct.cs |
Adds secretKeyRef environment values. |
src/Aspire.Hosting.Radius/Publishing/Constructs/LegacyApplicationEnvironmentConstruct.cs |
Updates legacy-resource documentation. |
src/Aspire.Hosting.Radius/Publishing/Constructs/LegacyRecipeEntryConstruct.cs |
Clarifies legacy recipe fields. |
src/Aspire.Hosting.Radius/Publishing/Constructs/RadiusResourceTypeConstruct.cs |
Adds backing-resource schema properties. |
src/Aspire.Hosting.Radius/Publishing/Constructs/RadiusSecuritySecretConstruct.cs |
Models Radius.Security/secrets. |
src/Aspire.Hosting.Radius/Publishing/Constructs/RecipeEntryConstruct.cs |
Uses Radius 0.60 recipe-pack fields. |
src/Aspire.Hosting.Radius/Publishing/RadiusBackingConnections.cs |
Defines connection-projection schemas. |
src/Aspire.Hosting.Radius/Publishing/RadiusInfrastructureBuilder.cs |
Implements projection, diagnostics, and secrets. |
src/Aspire.Hosting.Radius/Publishing/RadiusInfrastructureOptions.cs |
Exposes generated security secrets. |
src/Aspire.Hosting.Radius/Publishing/RadiusUnresolvableValueException.cs |
Narrows skippable resolution failures. |
src/Aspire.Hosting.Radius/ResourceMapping/RadiusResourceTypes.cs |
Updates Radius 0.60 type constants. |
src/Aspire.Hosting.Radius/ResourceMapping/ResourceTypeMapper.cs |
Migrates resource mappings and fallbacks. |
tests/Aspire.Cli.EndToEnd.Tests/Helpers/KubernetesDeployTestHelpers.cs |
Updates Radius helper documentation. |
tests/Aspire.Cli.EndToEnd.Tests/Helpers/KubernetesE2EVersions.cs |
Pins E2E Radius to 0.60. |
tests/Aspire.Cli.EndToEnd.Tests/RadiusDeployTests.cs |
Adds real backing-resource deployments. |
tests/Aspire.Cli.EndToEnd.Tests/RadiusPublishTests.cs |
Updates extension-version expectations. |
tests/Aspire.Deployment.EndToEnd.Tests/RadiusAzureResourcesDeploymentTests.cs |
Updates Radius-version documentation. |
tests/Aspire.Deployment.EndToEnd.Tests/RadiusStarterDeploymentTests.cs |
Upgrades AKS deployment coverage to 0.60. |
tests/Aspire.Hosting.Radius.Tests/DeploymentE2E/DeployEndToEndTests.cs |
Expands generated-resource checks. |
tests/Aspire.Hosting.Radius.Tests/Publishing/BackingResourceContractTests.cs |
Verifies mapping and recipe invariants. |
tests/Aspire.Hosting.Radius.Tests/Publishing/BackingResourceProjectionTests.cs |
Tests endpoint and credential projection. |
tests/Aspire.Hosting.Radius.Tests/Publishing/BackingResourceValueResolutionTests.cs |
Tests value-resolution edge cases. |
tests/Aspire.Hosting.Radius.Tests/Publishing/BicepGenerationMultiResourceTests.cs |
Updates multi-resource expectations. |
tests/Aspire.Hosting.Radius.Tests/Publishing/BicepSyntaxValidationTests.cs |
Expects the Redis UDT. |
tests/Aspire.Hosting.Radius.Tests/Publishing/ConfigureRadiusInfrastructureTests.cs |
Tests Radius 0.60 recipe fields. |
tests/Aspire.Hosting.Radius.Tests/Publishing/ContainerSecretEnvironmentTests.cs |
Tests secret-backed environment variables. |
tests/Aspire.Hosting.Radius.Tests/Publishing/LegacyFallbackEmissionTests.cs |
Updates legacy/UDT scenarios. |
tests/Aspire.Hosting.Radius.Tests/RadiusEnvironmentResourceTests.cs |
Tests cross-publisher TLS guards. |
tests/Aspire.Hosting.Radius.Tests/Recipes/RecipePackParametersBicepTests.cs |
Updates the legacy recipe fixture. |
tests/Aspire.Hosting.Radius.Tests/RecordingLogger.cs |
Adds diagnostic capture support. |
tests/Aspire.Hosting.Radius.Tests/ResourceMapping/ResourceTypeMapperTests.cs |
Verifies updated type mappings. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/BackingResourceProjectionTests.AllBackingResourceTypes_ProjectRecipeOutputs.verified.bicep |
Captures all projected resource types. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/BackingResourceProjectionTests.CallbackRenamingBackingResource_RewiresProjectedEnvironmentValues.verified.bicep |
Captures callback rewiring. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/BackingResourceProjectionTests.DirectEndpointPropertyReference_ProjectsRecipeOutputs.verified.bicep |
Captures direct endpoint projection. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/BackingResourceProjectionTests.UnauthenticatedBackingResource_DoesNotLeakAspireGeneratedPasswordParameter.verified.bicep |
Captures unauthenticated Redis output. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/BackingResourceValueResolutionTests.UserNameParameter_IsProjectedFromRecipeOutputs.verified.bicep |
Captures username projection. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/LegacyFallbackEmissionTests.LegacyAndUdt_ShareResourceNameAndUseDistinctParents.verified.bicep |
Captures mixed parent references. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/LegacyFallbackEmissionTests.LegacyOnly_EmitsLegacyParentsAndNoUdtResources.verified.bicep |
Captures MongoDB legacy-only output. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/LegacyFallbackEmissionTests.MixedLegacyAndUdt_EmitsBothParentPairs.verified.bicep |
Captures mixed legacy/UDT output. |
tests/Aspire.Hosting.Radius.Tests/Snapshots/LegacyFallbackEmissionTests.UdtOnly_DoesNotEmitLegacyParents.verified.bicep |
Captures PostgreSQL UDT output. |
…ations Two review findings on microsoft#19555. ASPIRERADIUS080 only saw consumers recorded by a ResourceRelationshipAnnotation, so `WithEnvironment(ctx => ctx.EnvironmentVariables["CS"] = db)` — which builds its value inline and records no annotation — silently received a connection string naming a database the legacy `sqldatabases` recipe never creates. The warning is now driven off the union of the annotations and the connection strings actually resolved during the publish, which means it has to run after every container's environment has been built rather than inline with credential wiring. Separately, several diagnostics pointed at a remediation that cannot be followed: `username`/`password`/`database` are internal schema properties, so a ConfigureRadiusInfrastructure callback cannot set them, and RecipeParameters is not a substitute because it emits under a different part of the resource body. ASPIRERADIUS074 (secret removed, and the projected-property site, which also called a schema property a "recipe parameter") and ASPIRERADIUS086 now say what is actually possible. The container env var sites keep their advice: `Env` is public and genuinely settable from a callback. Co-authored-by: Copilot <[email protected]>
2db3af0 to
4108832
Compare
…ations Two review findings on #19555. ASPIRERADIUS080 only saw consumers recorded by a ResourceRelationshipAnnotation, so `WithEnvironment(ctx => ctx.EnvironmentVariables["CS"] = db)` — which builds its value inline and records no annotation — silently received a connection string naming a database the legacy `sqldatabases` recipe never creates. The warning is now driven off the union of the annotations and the connection strings actually resolved during the publish, which means it has to run after every container's environment has been built rather than inline with credential wiring. Separately, several diagnostics pointed at a remediation that cannot be followed: `username`/`password`/`database` are internal schema properties, so a ConfigureRadiusInfrastructure callback cannot set them, and RecipeParameters is not a substitute because it emits under a different part of the resource body. ASPIRERADIUS074 (secret removed, and the projected-property site, which also called a schema property a "recipe parameter") and ASPIRERADIUS086 now say what is actually possible. The container env var sites keep their advice: `Env` is public and genuinely settable from a callback. Co-authored-by: Copilot <[email protected]>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 45 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
src/Aspire.Hosting.Radius/README.md:251
- “Any supplied password” incorrectly includes an AppHost-authored password, which is not discarded: it aborts publishing with
ASPIRERADIUS085. Distinguish that from the generated-passwordASPIRERADIUS075path, as the diagnostics section already does.
For resources emitted as legacy `Applications.*` types (MongoDB, SQL Server), a password or user name the AppHost supplies as a parameter is *not* used when deploying to Radius — the recipe generates its own. Aspire replaces it with the recipe's value and logs a warning, since the parameter's value never reaches the cluster. Passwords Aspire generated itself are replaced silently. Resources emitted as `Radius.*` types (PostgreSQL, RabbitMQ) behave the opposite way: the parameter *is* handed to the recipe — directly on the resource's properties for PostgreSQL, through a `Radius.Security/secrets` resource for RabbitMQ — so the value the AppHost supplied is the deployed credential and nothing is replaced. Redis is neither: its recipe deploys an unauthenticated server, so any supplied password is discarded with `ASPIRERADIUS075`.
src/Aspire.Hosting.Radius/README.md:243
- This table says every Redis password is discarded with
ASPIRERADIUS075, but an explicitly supplied password actually fails publishing withASPIRERADIUS085; only Aspire-generated passwords are discarded. Qualify both outcomes so users do not expect an explicit authentication request to publish successfully.
This issue also appears on line 251 of the same file.
| Password, for Redis | Nothing. The pinned `kube-recipes/rediscaches` recipe deploys Redis **without authentication** and publishes no password secret, so consumers receive an empty password and a warning names the discarded value (`ASPIRERADIUS075`) |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 45 changed files in this pull request and generated no new comments.
Suppressed comments (2)
src/Aspire.Hosting.Radius/Publishing/Constructs/ContainerEnvVarConstruct.cs:66
- The new public surface permits states that its contract says are invalid: callers can assign only one of
SecretName/SecretKey, or assign them on an existing value entry and emit bothvalueandvalueFrom. Those artifacts are rejected downstream by the container/Kubernetes schema. Model the secret reference as one atomic alternative, or add post-callback validation that requires both fields and rejects coexistence withValue.
public BicepValue<string> SecretName
{
get { Initialize(); return _secretName!; }
set { Initialize(); _secretName!.Assign(value); }
}
/// <summary>
/// The key within the secret resource's <c>data</c> map. Emitted only when assigned, and
/// mutually exclusive with <see cref="Value"/>.
/// </summary>
public BicepValue<string> SecretKey
{
get { Initialize(); return _secretKey!; }
set { Initialize(); _secretKey!.Assign(value); }
src/Aspire.Hosting.Radius/Publishing/Constructs/RadiusSecuritySecretConstruct.cs:70
- These remarks are already stale: this PR uses the construct for credential-bearing container environment variables in
CreateContainerEnvSecret, so container use is no longer “later work.” Document both current uses to keep the public API description accurate.
/// This construct is the canonical secret primitive for the <c>Radius.*</c> surface. It is used
/// today to hold credentials that a UDT backing resource consumes by resource ID (for example
/// the RabbitMQ <c>properties.password</c>), and is intended to be reused rather than duplicated
/// by later work that needs to hand a secret to a container env var.
Nell Shamrell-Harrington (nellshamrell)
left a comment
There was a problem hiding this comment.
Reviewed the full builder diff, the new connection-schema/type-mapper/environment code, the new constructs, and the deploy E2E tests, and cross-checked the diagnostic codes against the README.
2 findings: 1 correctness gap in the callback escape hatch, and 1 informational test-coverage note. The three already-resolved review threads (lowercased secret names, callback-only ASPIRERADIUS080 consumers, impossible callback remediations) are not repeated here.
The deployment behavior change is backed by real rad deploy-to-KinD end-to-end coverage rather than snapshots alone, which is the right shape for this kind of change.
…ations Two review findings on #19555. ASPIRERADIUS080 only saw consumers recorded by a ResourceRelationshipAnnotation, so `WithEnvironment(ctx => ctx.EnvironmentVariables["CS"] = db)` — which builds its value inline and records no annotation — silently received a connection string naming a database the legacy `sqldatabases` recipe never creates. The warning is now driven off the union of the annotations and the connection strings actually resolved during the publish, which means it has to run after every container's environment has been built rather than inline with credential wiring. Separately, several diagnostics pointed at a remediation that cannot be followed: `username`/`password`/`database` are internal schema properties, so a ConfigureRadiusInfrastructure callback cannot set them, and RecipeParameters is not a substitute because it emits under a different part of the resource body. ASPIRERADIUS074 (secret removed, and the projected-property site, which also called a schema property a "recipe parameter") and ASPIRERADIUS086 now say what is actually possible. The container env var sites keep their advice: `Env` is public and genuinely settable from a callback. Co-authored-by: Copilot <[email protected]>
cb9c774 to
910a8de
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 45 out of 46 changed files in this pull request and generated 3 comments.
Suppressed comments (1)
src/Aspire.Hosting.Radius/README.md:251
- This repeats the same incorrect Redis behavior: explicitly supplied passwords are not discarded with
ASPIRERADIUS075; they fail withASPIRERADIUS085. Only generated passwords are discarded.
For resources emitted as legacy `Applications.*` types (MongoDB, SQL Server), a password or user name the AppHost supplies as a parameter is *not* used when deploying to Radius — the recipe generates its own. Aspire replaces it with the recipe's value and logs a warning, since the parameter's value never reaches the cluster. Passwords Aspire generated itself are replaced silently. Resources emitted as `Radius.*` types (PostgreSQL, RabbitMQ) behave the opposite way: the parameter *is* handed to the recipe — directly on the resource's properties for PostgreSQL, through a `Radius.Security/secrets` resource for RabbitMQ — so the value the AppHost supplied is the deployed credential and nothing is replaced. Redis is neither: its recipe deploys an unauthenticated server, so any supplied password is discarded with `ASPIRERADIUS075`.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Fixes the nine findings from review, plus three defects found while verifying them: - Re-register the secrets recipe through the same construction path as the first pass, so a callback that drops the entry gets it back with the environment-wide and type-scoped recipe parameters applied. - Narrow the conditional-condition catch to MissingParameterValueException and InvalidOperationException from a manifest expression, so unrelated failures are no longer swallowed. - Validate the final Kubernetes Secret name and data keys after callbacks (ASPIRERADIUS088), rather than letting the API server reject them at deploy. - Reject a Radius.Security/secrets credential whose key was removed or whose value was changed after the credential was already composed into consumers' connection strings (ASPIRERADIUS089), and run the callback-ownership check first so handing the property off stays legal. - Fail publish when two Radius resources resolve to one Kubernetes Secret and at least one of them creates it (ASPIRERADIUS090). Sealed stores claim through their validated manifest, because the apply step selects them from the application model and applies them even when a callback removed the emitted construct. - Reject a ContainerEnvVarConstruct left with nothing set (ASPIRERADIUS087). - Re-enable the AKS Radius deployment test and extend the kind end-to-end test with MongoDB, which is the only live coverage of listSecrets() password and username projection. Co-authored-by: Copilot <[email protected]>
The round-3 guards each fell short of what their own comments claimed. - Classify a conditional's condition by shape instead of by marker. Gating the ASPIRERADIUS078 skip on `Condition is IManifestExpressionProvider` was nearly vacuous: IExpressionValue derives from that marker, so a parameter, a reference expression or a connection string all carried it, and a genuine failure inside one was still downgraded to a warning that dropped the environment variable. IsDeploymentSubstituted mirrors the type dispatch in ResolveEnvPartsAsync, where the marker test is meaningful because it sits in the default arm. A conditional expression's ValueProviders is the union of its two branches and excludes its own Condition, so a nested conditional needs a dedicated case; a visited set keeps the walk terminating on a cyclic connection string and answers false there, so an incomplete traversal is never the reason a variable is dropped. ContainerImageReference is excluded from the default arm because it carries the marker but resolves eagerly, so its failure names a real configuration error. - Compare the credential entry's encoding alongside its value (ASPIRERADIUS089). The encoding decides how the recipe interprets the value, so flipping `string` to `base64` provisions a server with a credential no consumer holds while leaving the value byte-identical. - Validate an inline secret store's final StoreName (ASPIRERADIUS088). The collision pass already treats it as the Kubernetes object name, and ASPIRERADIUS049 only guards the pre-callback model name. Existing and sealed stores are excluded because they name their object through `resource`, matching the gate the collision pass uses. Co-authored-by: Copilot <[email protected]>
- Catch a parameter-supplied `guest` RabbitMQ user name in the
ASPIRERADIUS082 guard. The guard only compared the rendered Bicep, which
is a literal only for a literal user name — so supplying a parameter, the
very remediation the diagnostic recommends, routed users around it.
The parameter's value is now resolved at publish time.
- Turn the silent Radius v0.59 incompatibility into a loud failure. A new
`verify-radius-control-plane-{env}` pipeline step reads `rad version
--output json` and fails with ASPIRERADIUS091 when the control plane is
older than v0.60, before credential registration or sealed-secret apply
mutate anything. An unreadable version is allowed through so the gate
cannot become a new way for valid deploys to fail.
- Mark DeployRadiusRedisRabbitMqAndMongoBackingResourcesToKind as
[OuterloopTest]: three KinD + Radius control-plane installs per PR run
exceeded the per-PR CI budget.
- Replace the discouraged Assert.DoesNotContain checks in the CLI E2E test
with a single assertion over the complete emitted resource type set.
- Correct the comment on
UnauthenticatedBackingResource_DoesNotLeakAspireGeneratedPasswordParameter:
Redis's recipe publishes no credential output, so the projected values are
empty rather than reading listSecrets().
- Fix the "Securitity" test name typo.
Co-authored-by: Copilot <[email protected]>
Control plane version gate now inspects the right cluster (blocking). `rad version` accepts no context flag and leaves the CLI's KubeContext unset, so the gate was reading whatever context the ambient kubeconfig happened to point at rather than the cluster `rad deploy` targets — it could approve an unsupported 0.59 cluster or reject a supported one. Extracted the workspace kube-context resolver out of SealedSecretApplyStep into a shared RadiusWorkspaceKubeContext (including the ASPIRE_RADIUS_KUBE_CONTEXT override) and had the gate flatten that single context into a throwaway kubeconfig with `kubectl config view --minify`, pointing the child `rad version` at it via KUBECONFIG. An unresolvable context now skips the gate rather than falling back to ambient state: a verdict about the wrong cluster is worse than no verdict. Fix ASPIRERADIUS056 on a valid model. One parameter used by both WithEnvironment and a type-scoped recipe parameter allocated two Bicep params for one Aspire parameter, because only GetOrAddEnvParameter reused the other allocator's declaration. Made the reuse bidirectional, and unified both allocators on BicepPostProcessor.SanitizeIdentifier — the SDK's NormalizeBicepIdentifier does not reserve `radius`, so a parameter by that name emitted a bare `param radius` colliding with the `extension radius` alias. Fix ASPIRERADIUS090 false positive. Two stores populated from one sealed manifest — the documented way to split a multi-key manifest — were reported as colliding writers. Byte-identical manifests are now coalesced and the diagnostic is reserved for distinct manifests targeting one object, which really do clobber each other. Reject a security secret with no name. An unset SecretName rendered as null, which the DNS-1123 check skipped, so publish emitted a Radius.Security/secrets block with no `name` that failed only at deploy. Add ASPIRERADIUS092 for kind/data-shape mismatches. Kind is public and freely mutable, so a callback could select basicAuthentication, certificate, azureWorkloadIdentity or awsIRSA without the keys those kinds require; the pinned recipe turns that into an invalid metadata.name at deploy. Literal recognized kinds are now validated; expression-valued and unrecognized kinds are left alone for forward compatibility. Also hardened the gate's process helper: cancellation kills the process tree, tolerates a refused kill, and reaps/observes the child under a bounded timeout so a child that will not die cannot hang a cancelled deploy. Co-authored-by: Copilot <[email protected]>
…one, and validate the fields both types require Five findings from the second review pass. Radius.Security/secrets does not share the legacy Applications.Core/secretStores vocabulary. Its v0.60 kind enum is generic, certificate-pem, certificate-pkcs12, basicAuthentication, awsIRSA and azureWorkloadIdentity; the bare 'certificate' spelling belongs to the legacy type only. Validating the new type against the legacy table therefore missed certificate-pem's tls.crt/tls.key contract entirely while treating the invalid 'certificate' as recognized. RadiusSecuritySecretKinds is a separate table for the new type, TryParseRadiusTypeString stays the legacy parser, and ValidateSecretStoreTypeRequiredKeys gives it a post-callback caller so both surfaces are covered symmetrically. Both gates fail open on an unrecognized literal: a newer control plane may extend either enum, and there is no way for an AppHost author to opt out of a publish-time gate. The two legacy spellings are the exception -- 'certificate' as a kind and 'raw' as an encoding are not future values, they are the vocabulary this type replaced, so they are named and rejected with a message that points at the migration. ASPIRERADIUS087 now also checks a complete-but-invalid secretKeyRef. Both halves are copied verbatim into the pod spec, so a literal SecretName that is not a DNS-1123 subdomain, or a SecretKey that is not a valid Secret data key, previously passed publish and rad deploy and was rejected only when the API server created the pod. Expression-valued halves are still allowed: RewireContainerEnvSecrets assigns one on purpose. New ASPIRERADIUS093 covers the fields the type requires and the callback can drop. properties.environment and every data entry's value are required, and an unset BicepValue is simply omitted from the emitted Bicep rather than failing to compile, so the artifact published cleanly and failed only at Radius schema validation. A null or unset dictionary entry is rejected the same way; an entry whose whole wrapper is an expression still resolves at deploy time and is skipped. RadiusBackingResourceProjectionException deliberately does not take an [Experimental] attribute. ASPIRERADIUS004 gates the ConfigureRadiusInfrastructure escape hatch, but this exception is thrown from ordinary publish through the ungated AddRadiusEnvironment, so gating it would force a suppression purely in order to catch an exception an ungated API throws. The PR description claimed otherwise and has been corrected, along with a claim about a deployment test that was merged into the broader outerloop one. Co-authored-by: Copilot <[email protected]>
RewireSecretResourceCredentials repaired a Radius.Security/secrets resource's EnvironmentId/ApplicationId inside the per-credential loop, after the guards that skip a credential whose consumer a callback removed or whose consumer property it reassigned. The secret outlives its consumer, though: it stays in options.SecuritySecrets and is still emitted. So a callback that renamed the environment and removed the consumer left the orphaned secret scoped to the symbol the rename retired, which reached the artifact as a dangling reference that only bicep compilation rejects, with nothing naming the callback responsible. Hoist the scope repair into an unconditional per-secret loop, mirroring RewireContainerEnvSecrets, which already had this shape. The repair is keyed per secret rather than per credential for the same reason called out there: the last-write-wins comparison only holds against the value the publisher wrote, so repairing once per credential would mis-detect on a second credential sharing a secret. Also split ASPIRERADIUS071, which covered two unrelated causes, so the diagnostic identifies which invariant broke. It now means only "an emitted Radius type has no connection schema row"; the two sites asserting that a credential-carrying secret has an environment to be scoped to move to ASPIRERADIUS094. Both README rows now state plainly that these are internal invariants an AppHost cannot trigger, rather than leaving readers hunting for an AppHost-side fix. Co-authored-by: Copilot <[email protected]>
Aspire.Hosting.Radius uses KnownRelationshipTypes and EnvironmentVariableNameEncoder but never included their source files, reaching them through InternalsVisibleTo on Aspire.Hosting instead. That is not a contract the shared sources offer, and main has since stopped granting it, so merging main into this branch fails the build with four errors: CS0122 on each of the three use sites, plus IDE0005 on the now-apparently-unused `using Aspire.Dashboard.Model`, which is the namespace KnownRelationshipTypes lives in. Include both files the way every other consumer does — Aspire.Hosting, Aspire.Hosting.Azure, Aspire.Hosting.DevTunnels and Aspire.Dashboard all take them as $(SharedDir) Compile items. That resolves all four errors, since the using becomes necessary again once the type resolves from source rather than from a referenced assembly. Co-authored-by: Copilot <[email protected]>
This reverts commit 6522810.
Radius reads internal members of Aspire.Hosting that have no public equivalent -- ProjectLaunchDefaultsAnnotation.DefaultHttpsEndpoint is the clearest example. Main removed the Aspire.Hosting.Radius friend declaration in #19620 as unnecessary, which was true of Radius as it stood on main, but the backing-resource work in this PR reintroduced the dependency. Because the branch never modified that hunk, the three-way merge took main's deletion, so the merged tree failed to build even though the branch built on its own. Merging main and restoring the entry here records the decision in branch history instead of leaving it to be silently dropped again. This also replaces the earlier attempt to pull KnownRelationshipTypes and EnvironmentVariableNameEncoder in as $(SharedDir) Compile items. That fixed the merged build but broke the branch-only build with CS0436, because those types were then defined in two places; it also could not have addressed DefaultHttpsEndpoint, which is not shared source. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: nellshamrell <[email protected]>
Addresses review feedback: setting KUBECONFIG did not actually point `rad version` at the workspace's cluster. Parts of the Radius CLI load `clientcmd.RecommendedHomeFile` (~/.kube/config) directly through pkg/kubeutil and ignore KUBECONFIG, so a supported ambient cluster could let an unsupported workspace target pass the gate (or the reverse), reintroducing the silent broken deployment ASPIRERADIUS091 exists to prevent. The minified kubeconfig is now written to <temp>/.kube/config and the child `rad version` runs against that directory as its home: HOME and USERPROFILE are redirected and HOMEDRIVE/HOMEPATH are removed, covering every variable client-go's homedir.HomeDir() consults on Unix and Windows. KUBECONFIG still points at the same file for the loaders that do honor it, so every loader inside `rad` reaches the workspace cluster. RunAsync now treats a null environment value as "remove this variable" so HOMEDRIVE/HOMEPATH can be cleared rather than blanked. Co-authored-by: Copilot <[email protected]>
Addresses two review findings. Database selection for a recipe-backed resource has to run before any container environment is resolved, so it can only see WithReference annotations. A mixed model defeated that: `WithReference(first)` plus a `WithEnvironment` callback resolving `second.ConnectionStringExpression` selected `first`, while the consumer received a connection string naming `second` — a database the recipe never creates, failing at run time with nothing in the generated Bicep to explain it. The consumption set that would have caught it was only read by the SQL Server ASPIRERADIUS080 warning pass. The selection is now recorded and validated in a deferred pass that runs once every container environment has been resolved, alongside the existing warning pass, and rejects any consumed database child other than the selected one with ASPIRERADIUS072. The database-child expression map is now derived from the emitted-type table rather than from the sets filled during the credential pass. Those sets are populated while that same pass triggers the map's first lookup, so a resource wired before its own selection was recorded would have been missing from the map and its consumers left unobserved. Also drops the branch/PR history from the Aspire.Hosting.Radius InternalsVisibleTo comment, keeping it focused on why the grant exists. Co-authored-by: Copilot <[email protected]>
A ConfigureRadiusInfrastructure callback can drop a broker from options.ResourceTypeInstances after its user-name parameter was recorded. The parameter can still reach the deploy step through another consumer, so the stale mapping failed 'aspire deploy' with ASPIRERADIUS082 naming a broker the deployment does not contain. Only brokers whose construct survived the callbacks are validated now. Co-authored-by: Copilot <[email protected]>
The pinned 0.60 Radius extension models Radius.Security/secrets 'kind' and
'encoding', and Applications.Core/secretStores 'type', as closed unions of
string literals in types.json. An unrecognized literal therefore fails
'bicep build' during rad deploy, and a newer control plane cannot make it valid
because the compile step reads the pinned definitions. Publishing one only
produced an artifact that cannot deploy, so reject it where the message can name
the resource. Expression-valued fields keep their escape path.
Separately, database selection counted child resources rather than distinct
deployed database names, so aliases for one physical database -
AddDatabase("orders-a", "orders") alongside AddDatabase("orders-b", "orders") -
were rejected with ASPIRERADIUS072 even though the single recipe-provisioned
database satisfies both consumers.
Co-authored-by: Copilot <[email protected]>
kubectl config view --minify emits file paths for client certificates, keys and token files rather than inlining them. kubeconfig resolves relative paths against the file's own location, so relocating the export under the temporary home broke them: rad version failed and the control plane gate skipped, letting an unsupported version through. --flatten makes the export self-contained. A user-name parameter shared by several brokers also overwrote earlier owners in a one-to-one map, so removing whichever broker was recorded last dropped the deploy-time guest check for the brokers that survived. Every owner is kept now and the check applies while any of them remains live. Co-authored-by: Copilot <[email protected]>
…hild Addresses two review findings on RadiusInfrastructureBuilder. RewireContainerEnvSecrets only treated a changed `SecretName` as a callback re-point, then validated the key the *publisher* generated rather than the one the variable currently carries. A callback that changed only `SecretKey` slipped past both: the original key was still present, so the publish succeeded while the emitted `secretKeyRef` named a key that does not exist. Radius accepts that artifact and it surfaces only as a pod that never starts. The current key is now resolved and validated against the generated secret, with a message that distinguishes a re-point from a removed key. A key that renders as a Bicep expression resolves at deploy time and a cleared key is already covered by ASPIRERADIUS087, so both are left alone. The recipe database selection fell back to `databaseChildren[0]` unless exactly one child was referenced. Multiple referenced children are legal when they alias one physical database, and ASPIRERADIUS072 has already rejected the case where they do not, so any referenced child is a correct choice. Selecting the first declared child instead pointed the recipe at an unreferenced database and made the deferred check reject a supported alias model. Regression tests cover a re-point to a missing key, a re-point to a key the callback added, and aliased children declared after an unreferenced child. Co-authored-by: Copilot <[email protected]>
Review feedback asked for the `StartsWith("..")` check to be removed from
KubernetesName.IsValidSecretDataKey on the grounds that apimachinery's
IsConfigMapKey rejects only the exact keys "." and "..". It rejects the prefix
too: IsConfigMapKey delegates to hasChDirPrefix, whose third case is
`strings.HasPrefix(value, "..")` -> "must not start with '..'". Removing the
check would let Aspire publish a key the API server rejects, moving the failure
from publish time to deploy time, which is what this validation exists to
prevent.
Keeping the behavior and pinning it instead: a regression test asserts that
`..token` is rejected with ASPIRERADIUS083, and the comment on
IsValidSecretDataKey now says why the prefix rule exists on top of the character
class (the kubelet atomic-writer's `..data` symlink) and names hasChDirPrefix,
since the character class alone reads as though `..token` were acceptable.
Co-authored-by: Copilot <[email protected]>
…solated home The gate redirects HOME so the parts of `rad` that read ~/.kube/config directly resolve the workspace's minified kubeconfig instead of the ambient cluster. `--flatten` inlines file-backed certificates, keys and token files, but it carries kubeconfig `exec` entries through untouched, and those shell out at load time. Every managed cluster authenticates that way — kubelogin for AKS, `aws eks get-token` for EKS, gke-gcloud-auth-plugin for GKE — and each helper resolves its credentials under the home directory. Under a bare redirect they found an empty home, failed to authenticate and took `rad version` down with them; because the gate fails open on a version it cannot read, it then skipped silently for exactly the population it is most needed for, letting an unsupported 0.59 control plane through. Each helper's state is now pinned back to the real home through the variable it already documents for relocating it (AZURE_CONFIG_DIR, AWS_CONFIG_FILE, AWS_SHARED_CREDENTIALS_FILE, CLOUDSDK_CONFIG). The kubeconfig stays isolated, so the gate still inspects the workspace's cluster. A variable the user has already set is left alone, since the child inherits the ambient environment and an explicit value may deliberately point elsewhere, and nothing is pinned when no home can be resolved. Also documents that RadiusInfrastructureOptions.SecuritySecrets carries two kinds of entry: credentials a backing resource consumes by resource ID, and the per-container secrets backing credential-bearing environment variables. Nothing distinguishes them structurally, so a callback treating every entry as backing-resource state can remove the secret a container reads from. Co-authored-by: Copilot <[email protected]>
The gate's supporting tests pinned version parsing, the diagnostic text, the isolated environment and step ordering, but nothing invoked the path that decides. The deployment tests install a supported v0.60 control plane, so a regression that mishandled a successful command result — reading the version as unknown and falling through the fail-open branch — would have kept every test green while doing exactly what the gate exists to prevent: letting a v0.59 cluster accept a deploy that silently discards the recipe pack. VerifyControlPlaneVersionAsync now takes the resolved Kubernetes context and a command runner, with the existing two-argument entry point composing the real resolver and process runner. Only the parts that need a live cluster are supplied by the caller; the decision itself runs unchanged, including exporting the kubeconfig to a temporary home and reading the version back. The new tests cover a 0.59 control plane failing with ASPIRERADIUS091 and 0.60 proceeding, that `rad` is run against the exported workspace kubeconfig rather than the ambient cluster, and that every way the environment can be uncooperative rather than unsupported still fails open. Verified against a deliberately regressed gate: the unsupported-control-plane test is the one that fails. Co-authored-by: Copilot <[email protected]>
Each of these explained the change rather than the code, so all three would have read as stale or unresolvable once merged. The legacy recipe map cited "a future PR" for why the inner map is keyed by recipe name. The durable reason is that Radius keys recipes by name within a type, so the map matches the schema whether or not more names are ever emitted. The legacy application comment attributed the shared `name:` to review feedback, which records how the shape was arrived at rather than why it is required: the legacy application is the same Radius application as the UDT one, and only the Bicep identifier is suffixed so the two declarations do not collide. The recipe-location test referenced the `L5`/`L1` design identifiers. It now describes the behavior under test, and says why the assertion looks for `source:` rather than the `RecipeLocation` member it sets. Co-authored-by: Copilot <[email protected]>
The workspace resolver read <process HOME>/.rad/config.yaml directly. `rad` has no configuration environment variable — the config is selected by the global `--config` flag — so that file describes the workspace only when `rad` runs with its default config. Anything that passes `--config`, including a shim wrapping `rad`, leaves the resolver inspecting an unrelated config or finding none. The Radius deployment E2E test is exactly that case: it shadows `rad` with a workspace-local shim that injects `--config <workspace>/.rad/config.yaml` and sets HOME inside the shim only, while the Aspire process keeps the real HOME. The version gate therefore resolved no context and skipped, so the test that is supposed to demonstrate the gate would have passed against a control plane the gate exists to reject — the gate fails open by design, and here it failed open silently in its own coverage. Resolution now asks `rad workspace show --output json` first, reading connection.context. That runs the same executable the deploy will spawn, found through the same PATH and therefore the same shim and config, so the answer describes the cluster actually being targeted. The config file is still read when `rad` is absent or cannot answer, preserving the previous behavior for the default-config case, and an explicit ASPIRE_RADIUS_KUBE_CONTEXT still wins. The sealed-secret step resolves through the same path. Both steps deliberately share this resolver so they cannot disagree about which cluster is being inspected, and fixing only the gate would have broken that. It matters more there than for the gate: a misresolved context makes it apply a SealedSecret to the wrong cluster, which writes, where the gate only reads a version. ProcessRunResult and the command-runner delegate move to namespace scope as RadiusCommandRunner, since they are now shared rather than gate-specific. Verified the coverage catches the regression: with the rad answer discarded so resolution falls back to the file, TryResolve_PrefersTheContextRadItselfReports fails. Full suite is 655 passing. Co-authored-by: Copilot <[email protected]>
Tests selector50 / 99 PR test projects · 4 PR jobs · 3 advisory-only targets, from 59 changed files. Selected PR test projects (50 / 99)
Selected PR jobs (4)
Advisory workflow impact (3)
How these were chosen — grouped by what changed
🔧 show 48
📦 affected project 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🔧 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
The CI build failed due to test failure(s) that appear unrelated to the PR changes. These may be flaky tests. Suspected flaky test(s):
Suggested actions:
You can re-run the failed jobs from the workflow run page. |
Open questions carried over from #19253
Two review questions were answered but never settled, and I would still like a call on each:
Applications.Datastores/sqlDatabasesrecipe only echoes itsdatabaseparameter back as an output — it never runsCREATE DATABASE— soAddSqlServer("sql").AddDatabase("appdb")hands the consumer a connection string naming a catalog the deployment does not contain. This PR warns (ASPIRERADIUS080) scoped to referenced database children, rather than failing, because the publisher cannot fix it, no published Kubernetes recipe exists forRadius.Data/sqlServerDatabases, and failing would regress models that work today (EF CoreMigrate(), orsaonmaster). Reviewers wanted a hard fail; I am happy to switch if that is the call, but it needs an escape hatch.RadiusUnresolvableValueExceptionnarrowing. TheGetDefaultPortthrow appears to be unreachable:ResolveServicePortallocates a port for a portless endpoint before that path is hit, and the one case that returns null is a project's synthetic HTTPS endpoint, whose schemeGetDefaultPortanswers.PortlessNonHttpEndpoint_IsResolvedRatherThanOmittedcovers it regardless. The open question is whether the throw should become aDebug.Assert.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.Scope
This started as the connection-projection fix above and grew, in review, into four related changes. They are together because each one is required for the first to actually work end to end — a projected connection value is only correct if it names the right recipe, survives the deploy, and does not leak on the way:
Radius.*UDTsrecipePacksfields the publisher writes. The API server drops unknown fields instead of rejecting them, so the pre-0.60 spelling publishes and deploys cleanly while producing an empty recipe pack — every backing resource then fails to resolve a recipe. Correct projection onto a silently-empty pack is still a broken deployment.valueFrom.secretKeyRefASPIRERADIUS069–086)Items 2 and 3 landed together in a single commit (
a3a8ffbb0), because the secret carrier they both depend on —Radius.Security/secrets— is introduced by 0.60; reviewing that commit on its own covers both.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 (MongoDB, SQL Server)<resource>.listSecrets().password<resource>.properties.usernameRadius.*types (PostgreSQL, RabbitMQ)username/passwordschema properties, using the same secure Bicep parameter Aspire composes into the connection string, so both sides agree by construction. RabbitMQ takes its password as the resource ID of aRadius.Security/secretsresource rather than as a stringASPIRERADIUS075; one supplied explicitly fails the publish withASPIRERADIUS085Because the substitution happens on the underlying values rather than on formatted strings, connection strings, URIs, and the individual properties emitted by
WithReferenceall resolve consistently.Failures that were previously silent are now reported by name. The full set is
ASPIRERADIUS069–086, tabulated insrc/Aspire.Hosting.Radius/README.md; the ones most likely to change the outcome for an existing AppHost: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.Scheme,TlsEnabled, orUrlfails withASPIRERADIUS081. No mapped Radius type publishes a transport-security output, so those values would describe how the resource runs locally (rediss://,ssl=true) against a server the recipe starts in plaintext.ASPIRERADIUS085rather than being dropped: the recipe deploys an unauthenticated server, and quietly downgrading an author's request for authentication is not a decision the publisher should make. A password Aspire generated is still dropped, with theASPIRERADIUS075warning.AddRabbitMQ(...)without an explicit user name fails withASPIRERADIUS082(see the 0.60 section below).AddSqlServer("sql").AddDatabase("appdb")warns withASPIRERADIUS080: the legacy SQL recipe echoes thedatabaseparameter into its outputs but never runsCREATE DATABASE, so the consumer was being handed a connection string naming a catalog the deployment does not contain.Breaking change: Radius v0.59 and earlier are no longer supported
Who is affected. Anyone using
Aspire.Hosting.Radiusagainst a Radius control plane older than v0.60. Radius v0.60 was released on 2026-01-27.What changes. The generated Bicep now targets the v0.60 schemas. Redis and RabbitMQ move onto their
Radius.*user-defined types, credentials are carried on the newRadius.Security/secretstype, and the recipe-pack fields are written with their v0.60 names (kind/source, renamed fromrecipeKind/recipeLocation).Why it matters more than a normal version bump. The Radius API server drops fields it does not recognize rather than rejecting them. On a v0.59 control plane the recipe-pack fields are silently discarded, so
aspire deployreports success and produces an application whose backing resources have no recipe — a cache, database, or queue that never provisions, with no error anywhere to explain it. This is the reason the change is called out as breaking rather than as a prerequisite bump: the failure mode is a silently non-functional deployment, not a failed deploy.What happens now.
aspire deployrefuses to deploy to an older control plane instead of producing that broken app. A preflight step reads the control-plane version and fails withASPIRERADIUS091:The check inspects the cluster the active
radworkspace targets (honoringASPIRE_RADIUS_KUBE_CONTEXT), not whatever contextkubectlhappens to point at. A version it cannot read — unreachable cluster, Radius not installed, an edge build — is allowed through, so the gate turns one silent failure loud without becoming a new way for valid deploys to fail.Action required. Run
rad upgrade kubernetesto bring the control plane to v0.60 or later, then deploy again. There is no in-package workaround: the schema change is in the Radius API, and no version negotiation exists to soften it.Radius 0.60 is now the minimum supported runtime
This is a breaking change for anyone deploying to Radius v0.59 or earlier, and the incompatibility is silent. v0.60 renamed the
Radius.Core/recipePacksfieldsrecipeKind/recipeLocationtokind/source. The Radius API server ignores fields it does not recognize rather than rejecting them, so deploying these artifacts to a v0.59 cluster produces an empty recipe pack with no publish error and no deploy error — and every backing resource then fails to resolve a recipe. There is no version negotiation available to soften this, so the package pins 0.60 and the README states the requirement up front.Because the failure is silent,
aspire deploynow refuses to deploy to an older control plane rather than producing a non-functional app: a preflight step readsrad versionand fails withASPIRERADIUS091. It runs as its own pipeline step ahead of everything that mutates the cluster or the machine, and it inspects the cluster the activeradworkspace targets (honoringASPIRE_RADIUS_KUBE_CONTEXT) rather than whatever contextkubectlcurrently points at, so it cannot deliver a verdict about the wrong cluster. A version it cannot read — unreachable cluster, Radius not installed, an edge build, or an unresolvable workspace context — is allowed through: the gate exists to turn one silent failure loud, not to become a new way for valid deploys to fail.What the upgrade brings with it:
Radius.*UDTs (Radius.Data/redisCaches,Radius.Messaging/rabbitMQ— note: notrabbitMQQueues) and their legacyApplications.*fallbacks are gone. MongoDB, SQL Server, and the Dapr building blocks stay on the legacy types, because their UDT equivalents still have no published Kubernetes recipe.Radius.Security/secretsis the new carrier for credentials a UDT consumes by resource ID. RabbitMQ'spasswordproperty takes the resource ID of a secrets resource, not a password string.ASPIRERADIUS082). The 0.60 schema restrictsguestto loopback connections, so a broker provisioned with the Aspire default would reject every workload pod — and the default arrives at the publisher as literal text inside the connection string, with no value to rewrite, so the broker and the connection string cannot be made to agree.:latest.resource-types-contribmoves:latestonly on a stable recipe release and publishes an immutable<sha>tag on every push tomain— the tag its own workflow documents as "the tag Radius pins against". Both recipes post-date the last stable release, so:latestdoes not exist for either, and referencing it fails at deploy time withRecipeDownloadFailed.edgeis not usable either: it floats, and a generated artifact must keep deploying the recipe it was published against.Credentials reach containers as secret references
Container environment variables were previously always emitted as
env: { NAME: { value: ... } }. Routing a credential through an@secure()Bicep parameter keeps it out of the published artifact, but the resolved string still lands in the KubernetesDeploymentspec — readable by anyone withget deploymentin the namespace, and retained in the rollout history after a rotation.A value that carries a credential is now written to a
Radius.Security/secretsresource named<container>-env-secretand referenced by key:A value counts as credential-bearing if it is built from a secret parameter (
AddParameter(name, secret: true), and the passwords Aspire generates for backing resources) or from a recipe'slistSecrets()output. Everything else keeps its plainvalue, so the deployed spec stays readable. Because the variable name becomes a KubernetesSecretdata key, it is validated at publish time against the full API-server contract — 1–253 characters of[-._a-zA-Z0-9], and not.,.., or..-prefixed — instead of failing when the Secret reaches the cluster (ASPIRERADIUS083).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:New public API
This PR adds six public API elements, all in
Aspire.Hosting.Radius. The five that are part of theConfigureRadiusInfrastructureescape hatch carry that surface's existingASPIRERADIUS004experimental gate — the two newContainerEnvVarConstructmembers inherit it from the type. The exception deliberately does not:RadiusBackingResourceProjectionExceptionAddRadiusEnvironment, which carries no experimental attribute, so gating it would force an AppHost author to suppress a diagnostic purely in order tocatchan exception an ungated API throws at them.RadiusSecuritySecretConstructRadius.Security/secretsresource in the Bicep AST. Reachable fromConfigureRadiusInfrastructure, which is the documented escape hatch for editing the emitted model.RadiusSecuritySecretDataEntryConstructdataentry on the above; needed to add or edit an entry from a callback.ContainerEnvVarConstruct.SecretNameRadius.Security/secretsresource a container env var reads from — thevalueFrom.secretKeyRef.secretNamehalf. Before this PR the type only modelled the plainvalueform.ContainerEnvVarConstruct.SecretKeydatamap — thevalueFrom.secretKeyRef.keyhalf.RadiusInfrastructureOptions.SecuritySecretsBecause the two construct types are mutable from a callback, their post-callback invariants are enforced by the publisher rather than by the type system:
ASPIRERADIUS088(invalid, or missing, Kubernetes object name and data keys),ASPIRERADIUS089(a replaced or mutated generated credential),ASPIRERADIUS090(two secrets resolving to one cluster object) andASPIRERADIUS092(aKindwhose recipe-required data keys are absent, or the legacycertificatespelling this type does not accept) andASPIRERADIUS093(a missingEnvironmentIdor entryValue, or the legacyrawencoding). The two newContainerEnvVarConstructmembers are mutually exclusive withValueand with each other's absence, which the type system also cannot express, soASPIRERADIUS087enforces it: both halves must be set, neither may accompany aValue, and a literalSecretName/SecretKeymust be a valid Kubernetes object name and data key respectively.The exception exists 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 — there is noghcr.io/radius-project/kube-recipes/sqlserverdatabasesrepository at all — 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–086, documented insrc/Aspire.Hosting.Radius/README.mdalong with the known gaps (the default MongoDB user name cannot be projected,Radius.Messaging/rabbitMQcarries aqueueproperty Aspire has no concept of,uriComponentescaping differs cosmetically fromUri.EscapeDataString, and only a resource's primary endpoint is projectable).ASPIRERADIUS076fails the publish when the recipe's input schema does not accept the credential properties the resource requires, which previously produced a resource nothing could authenticate against.ASPIRERADIUS081TLS guard is enforced inRadiusEnvironmentResourcerather than only in the publisher, so a Kubernetes, Azure Container Apps, or App Service consumer that resolves a Radius-owned endpoint throughComputeEnvironmentEndpointResolvergets the same failure instead of a locally-derivedrediss/TlsEnabled=True.Host/Port/HostAndPortstill project — the address is right regardless of transport.connectionNamerecovered from theConnectionStrings__<name>entry the same call emits) rather than from value equality. A user-authored value identical to an injected property is still silently replaced by the recipe credential, so it is now reported instead of exempted.Validation
Aspire.Hosting.Radius.Tests: 614 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 resource-type createplusrad bicep publish-extension) and to patch the published artifact, becauseRadius.Data/postgreSqlDatabaseswas absent from the Bicep extension at 0.59. Radius 0.60 ships the type in the pinned extension and registers it atrad install kubernetes, so all of that is gone: the test publishes and then runsaspire deployagainst the untouched artifacts, which is the path a user actually follows.DeployRadiusRedisRabbitMqAndMongoBackingResourcesToKind, covers the types whose 0.60 migration cannot be proven from a Bicep snapshot. RabbitMQ'spasswordtakes the resource ID of aRadius.Security/secretsresource, so only a real deployment shows that Radius dereferenced it and the broker enforces the projected credential. It also asserts the credential reaches the pod as asecretKeyRefand that the plaintext appears nowhere in the Deployment spec. It is marked[OuterloopTest]and therefore runs in the scheduled outerloop suite, not per-PR: it stands up a third KinD cluster, and three per PR is more CI budget than the incremental coverage justifies. The container and Postgres deploy tests above do run per-PR, so the Redis and RabbitMQ deployment paths specifically are covered on a schedule rather than on every change.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.listSecrets()is evaluated by the deployment engine, so the resolved secret is written into the consuming resource's Deployment spec (and is therefore readable by anything withget pod/get deploymentin the namespace, and by anyone who can read the deployment history that records the evaluated template output). The alternative - declaring the value@secure()- keeps it out of deployment history but requires the operator to supply it out of band, which defeats the point of a recipe that generates its own credential. The correct long-term shape is a secret reference so neither the artifact nor the Deployment spec carries the plaintext, and this PR now lands it: a container environment variable that carries a credential is published asvalueFrom.secretKeyRefagainst aRadius.Security/secretsresource named<container>-env-secret, rather than as an inlinevalue. Non-credential variables keep their plainvalue, so the deployed spec stays readable. Net: both the artifact-at-rest and the Deployment-spec exposure are reduced.secretsoutput at all, so no credential is projected. The generated connection string carries an empty password. A password Aspire generated is dropped with theASPIRERADIUS075warning; a password the AppHost author supplied fails the publish withASPIRERADIUS085, because silently downgrading an explicit request for authentication is a security decision the publisher should not make. This is the recipe's security posture, not a change introduced here - see the Known limitations section of the README.Fixes #18935
Checklist
<remarks />and<code />elements on your triple slash comments?