Skip to content

Commit d33923d

Browse files
committed
Change command to secret set
1 parent 9d31220 commit d33923d

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

articles/container-apps/manage-secrets.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ When you create a container app, secrets are defined using the `--secrets` param
8282
```bash
8383
az containerapp create \
8484
--resource-group "my-resource-group" \
85-
--name queuereader \
85+
--name "queuereader" \
8686
--environment "my-environment-name" \
87-
--image demos/queuereader:v1 \
87+
--image "demos/queuereader:v1" \
8888
--secrets "queue-connection-string=<CONNECTION_STRING>"
8989
```
9090

@@ -175,23 +175,22 @@ Replace `<KEY-VAULT-SECRET-URI>` with the URI of your secret in Key Vault.
175175

176176
# [Azure CLI](#tab/azure-cli)
177177

178-
When you create a container app, secrets are defined using the `--secrets` parameter.
178+
Secrets are managed using the `az containerapp secret` CLI subgroup.
179179

180-
- The parameter accepts a space-delimited set of name/value pairs.
180+
- The `--secrets` parameter accepts a space-delimited set of name/value pairs.
181181
- Each pair is delimited by an equals sign (`=`).
182182
- To specify a Key Vault reference, use the format `<SECRET_NAME>=keyvaultref:<KEY_VAULT_SECRET_URI>,identityref:<MANAGED_IDENTITY_ID>`. For example, `queue-connection-string=keyvaultref:https://mykeyvault.vault.azure.net/secrets/queuereader,identityref:/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-identity`.
183183

184+
The following command sets a secret for a container app using a Key Vault reference.
185+
184186
```bash
185-
az containerapp create \
187+
az containerapp secret set \
186188
--resource-group "my-resource-group" \
187-
--name queuereader \
188-
--environment "my-environment-name" \
189-
--image demos/queuereader:v1 \
190-
--user-assigned "<USER_ASSIGNED_IDENTITY_ID>" \
191-
--secrets "queue-connection-string=keyvaultref:<KEY_VAULT_SECRET_URI>,identityref:<USER_ASSIGNED_IDENTITY_ID>"
189+
--name "queuereader" \
190+
--secrets "queue-connection-string=keyvaultref:<KEY_VAULT_SECRET_URI>,identityref:<MANAGED_IDENTITY_ID>"
192191
```
193192

194-
Here, a connection string to a queue storage account is declared in the `--secrets` parameter. Replace `<KEY_VAULT_SECRET_URI>` with the URI of your secret in Key Vault. Replace `<USER_ASSIGNED_IDENTITY_ID>` with the resource ID of the user assigned identity. For system assigned identity, use `System` instead of the resource ID.
193+
Here, a connection string to a queue storage account is declared in the `--secrets` parameter. Replace `<KEY_VAULT_SECRET_URI>` with the URI of your secret in Key Vault. Replace `<MANAGED_IDENTITY_ID>` with the resource ID of a user assigned identity. For system assigned identity, use `System` instead of the resource ID. The identity must have access to the Key Vault secret.
195194

196195
# [PowerShell](#tab/powershell)
197196

0 commit comments

Comments
 (0)