Skip to main content
Guide

Secrets

Secrets are group-scoped key-value stores. Create them once on the sandbox group, then reference them from egress header transforms or telemetry authentication.

Create or update a secret

Secrets live on the sandbox group. Values are not auto-injected as environment variables. Reference them from supported sandbox group configuration such as egress-policy header transforms and OTLP telemetry authentication.

  1. Open sandboxes.azure.com/sandbox-groups and select your sandbox group.
  2. Select Secrets.
  3. Select Create.
  4. Enter a name, such as model-credentials.
  5. Add key-value pairs, such as API_KEY and MODEL.
  6. Select Save. To rotate values later, select the secret, enter replacement values, and save again.
aca sandboxgroup secret set \
--name model-credentials \
--key API_KEY \
--value sk-test-123

aca sandboxgroup secret set \
--name model-credentials \
--key MODEL \
--value gpt-4

aca sandboxgroup secret set \
--name model-credentials \
--key API_KEY \
--value sk-updated-456

List secrets and keys

List secrets to confirm that a name exists. List keys to see which entries are present without reading the stored values.

  1. Open the sandbox group and select Secrets.
  2. Review the secret list.
  3. Select a secret to view its key names.
  4. Use the search box to filter by secret name.
aca sandboxgroup secret show --name model-credentials
aca sandboxgroup secret show --name model-credentials --key API_KEY

Inspect metadata and values

Use metadata checks to confirm the secret shape. Use value reveal or SDK value peek only inside trusted code paths, and avoid printing full values to logs.

Values are masked by default in the portal

The portal detail panel can reveal and copy an individual saved secret value. Handle revealed values carefully, and avoid pasting them into logs or shared channels.

aca sandboxgroup secret list

Remove keys or delete a secret

Remove a key to keep the bundle and its remaining values. Delete the bundle only after every sandbox that needs it has moved to a replacement.

  1. Open the sandbox group and select Secrets.
  2. Select the secret.
  3. Select Delete and confirm.
aca sandboxgroup secret remove \
--name model-credentials \
--key MODEL \
--yes

aca sandboxgroup secret delete \
--name model-credentials \
--yes