Skip to content

Demonstrate Redis connection secret variables - #2650

Closed
willdavsmith wants to merge 4 commits into
edgefrom
willdavsmith-redis-secret-connection-demo
Closed

Demonstrate Redis connection secret variables#2650
willdavsmith wants to merge 4 commits into
edgefrom
willdavsmith-redis-secret-connection-demo

Conversation

@willdavsmith

@willdavsmith willdavsmith commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • connect the demo container to Redis with a single redis connection whose source is redis.id
  • demonstrate CONNECTION_REDIS_HOST and CONNECTION_REDIS_PORT as normal environment values from that connection
  • demonstrate CONNECTION_REDIS_URL as a secret-backed environment value injected through Kubernetes secretKeyRef
  • remove the extra generated-Secret connection and manual Secret resource ID reconstruction
  • make the Todo repository consume only CONNECTION_REDIS_URL, removing legacy URL and host/port construction fallbacks
  • keep environment-qualified application, container, and Redis names for concurrent CI runs
  • add the Redis demo workflow entry and verify HOST, PORT, and URL injection in Playwright

Dependencies

Depends on radius-project/radius#12709 and radius-project/resource-types-contrib#300. This PR demonstrates the runtime capability but does not implement it.

Validation

  • bicep format samples/demo/app-redis.bicep
  • bicep build samples/demo/app-redis.bicep --stdout
  • npm --prefix samples/demo run build
  • parsed .github/workflows/test.yaml
  • discovered all 9 demo Playwright tests across Chromium, Firefox, and WebKit
  • git diff --check

Notes

The existing native Kubernetes secretKeyRef samples continue to use <producer>.properties.secrets.name; this PR does not change those consumers.

Signed-off-by: willdavsmith <willdavsmith@gmail.com>
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Signed-off-by: willdavsmith <willdavsmith@gmail.com>
Signed-off-by: willdavsmith <willdavsmith@gmail.com>
Signed-off-by: willdavsmith <willdavsmith@gmail.com>
@willdavsmith willdavsmith changed the title Demonstrate Redis secret connections Demonstrate Redis connection secret variables Aug 19, 2026
@willdavsmith willdavsmith changed the title Demonstrate Redis connection secret variables Phase 2: demonstrate Redis connection secret variables Aug 20, 2026
@willdavsmith willdavsmith changed the title Phase 2: demonstrate Redis connection secret variables Demonstrate Redis connection secret variables Aug 20, 2026
pull Bot pushed a commit to TheTechOddBug/radius that referenced this pull request Aug 24, 2026
## Summary

Enables one connection to a Recipe-backed producer to carry both
ordinary values and non-sensitive managed Secret references.

This PR and radius-project/resource-types-contrib#300 together enable
the complete Kubernetes behavior. Either side safely tolerates the other
being absent, but producer-managed secret variables are available only
after both are deployed.

- Materializes Recipe secret outputs into the existing managed
`Radius.Security/secrets` resource.
- Keeps the managed Secret as the source of truth instead of persisting
duplicate reference metadata on the producer.
- Resolves the producer's `properties.secrets.name`, reads only the
backing Secret's stored `properties.data` keys, and derives
`{source,key}` references while constructing connection context. Secret
values are not decrypted or exposed.
- Exposes references to consuming Recipes as
`context.resource.connections.<name>.secrets.<key>`.
- Keeps ordinary properties under `connections.<name>.properties`.
- Preserves the public `properties.secrets.name` contract; no
`properties.secrets.id` is added.
- Reclaims the deterministically named managed Secret during output
shrinkage, schema removal, empty output, and deletion.

## Scope exclusions

- No generic `{{context.resource.connections.*.secrets.*}}` parameter
interpolation.
- No catalog-wide schema/example migration.
- No sample or agent-guidance changes.
- No ACI behavior change.
- No functional fixture that depends on the unmerged Container Recipe
from contrib #300; coordinated end-to-end coverage belongs in
resource-types-verification after both changes are available.

## Validation

- Targeted Go tests for dynamic-resource processing, backing-Secret
reference resolution, malformed and missing backing Secrets, public API
conversion, connected-resource enrichment, Recipe context serialization,
and lifecycle behavior.
- Architecture Markdown checks.
- An isolated manual kind deployment previously confirmed one Redis
connection generated ordinary host/port variables and secret-backed
`CONNECTION_REDIS_URL`, with no plaintext in the producer or Deployment,
API redaction, runtime Redis connectivity, Todo CRUD, direct
authored-Secret projection, and managed Secret cascade deletion.

## Related PRs

- Container Recipe support: radius-project/resource-types-contrib#300
- Sample adoption: radius-project/samples#2650
- Released-stack verification:
radius-project/resource-types-verification#41

---------

Signed-off-by: willdavsmith <willdavsmith@gmail.com>
Copilot-Session: 3f464dd8-0c43-447b-b5a6-5d4b078b69bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant