You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -19,15 +19,12 @@ Azure Container Apps allows your application to securely store sensitive configu
19
19
- Each application revision can reference one or more secrets.
20
20
- Multiple revisions can reference the same secret(s).
21
21
22
-
When a secret is updated or deleted, you can respond to changes in one of two ways:
22
+
An updated or deleted secret does not automatically impact existing revisions in your app. When a secret is updated or deleted, you can respond to changes in one of two ways:
23
23
24
24
1. Deploy a new revision.
25
25
2. Restart an existing revision.
26
26
27
-
An updated or removed secret does not automatically restart a revision.
28
-
29
-
- Before you delete a secret, deploy a new revision that no longer references the old secret.
30
-
- If you change a secret value, you need to restart the revision to consume the new value.
27
+
Before you delete a secret, deploy a new revision that no longer references the old secret. Then deactivate all revisions that reference the secret.
31
28
32
29
## Defining secrets
33
30
@@ -51,13 +48,13 @@ Secrets are defined at the application level in the `resources.properties.config
51
48
}
52
49
```
53
50
54
-
Here, a connection string to a queue storage account is declared in the `secrets` array. To use this configuration you would replace `<MY-CONNECTION-STRING-VALUE>` with the value of your connection string.
51
+
Here, a connection string to a queue storage account is declared in the `secrets` array. In this example, you would replace `<MY-CONNECTION-STRING-VALUE>` with the value of your connection string.
55
52
56
53
# [Azure CLI](#tab/azure-cli)
57
54
58
-
Secrets are defined using the `--secrets` parameter.
55
+
When you create a container app, secrets are defined using the `--secrets` parameter.
59
56
60
-
- The parameter accepts a comma-delimited set of name/value pairs.
57
+
- The parameter accepts a space-delimited set of name/value pairs.
Here, a connection string to a queue storage account is declared in the `--secrets` parameter. The value for `queue-connection-string` comes from an environment variable named `$CONNECTION_STRING`.
73
70
74
71
# [PowerShell](#tab/powershell)
75
72
76
-
Secrets are defined using the `--secrets` parameter.
73
+
When you create a container app, secrets are defined using the `--secrets` parameter.
77
74
78
-
- The parameter accepts a comma-delimited set of name/value pairs.
75
+
- The parameter accepts a space-delimited set of name/value pairs.
Here, a connection string to a queue storage account is declared in the `--secrets` parameter. The value for `queue-connection-string` comes from an environment variable named `$CONNECTION_STRING`.
91
88
92
89
---
93
90
94
-
## Using secrets
91
+
## <aname="using-secrets"></a>Referencing secrets in environment variables
95
92
96
-
The secret value is mapped to the secret name declared at the application level as described in the [defining secrets](#defining-secrets) section. The `passwordSecretRef` and `secretref` parameters are used to reference the secret names as environment variables at the container level. The `passwordSecretRef` provides a descriptive parameter name for secrets containing passwords.
93
+
After declaring secrets at the application level as described in the [defining secrets](#defining-secrets) section, you can reference them in environment variables when you create a new revision in your container app. When an environment variable references a secret, its value is populated with the value defined in the secret.
97
94
98
95
## Example
99
96
100
-
The following example shows an application that declares a connection string at the application level and is used throughout the configuration via `secretref`.
97
+
The following example shows an application that declares a connection string at the application level. This connection is referenced in a container environment variable and in a scale rule.
101
98
102
99
# [ARM template](#tab/arm-template)
103
100
104
101
In this example, the application connection string is declared as `queue-connection-string` and becomes available elsewhere in the configuration sections.
Here, the environment variable named `connection-string` gets its value from the application-level `queue-connection-string` secret. Also, the Azure Queue Storage scale rule's authorization configuration uses the `queue-connection-string` as a connection is established.
105
+
Here, the environment variable named `connection-string` gets its value from the application-level `queue-connection-string` secret. Also, the Azure Queue Storage scale rule's authentication configuration uses the `queue-connection-string`secret as to define its connection.
109
106
110
107
To avoid committing secret values to source control with your ARM template, pass secret values as ARM template parameters.
111
108
112
109
# [Azure CLI](#tab/azure-cli)
113
110
114
-
In this example, you create an application with a secret that's referenced in an environment variable using the Azure CLI.
111
+
In this example, you create a container app using the Azure CLI with a secret that's referenced in an environment variable. To reference a secret in an environment variable in the Azure CLI, set its value to `secretref:`, followed by the name of the secret.
Here, the environment variable named `connection-string` gets its value from the application-level `queue-connection-string` secret by using `secretref`.
123
+
Here, the environment variable named `connection-string` gets its value from the application-level `queue-connection-string` secret.
127
124
128
125
# [PowerShell](#tab/powershell)
129
126
130
-
In this example, you create an application with a secret that's referenced in an environment variable using the Azure CLI.
127
+
In this example, you create a container app using the Azure CLI with a secret that's referenced in an environment variable. To reference a secret in an environment variable in the Azure CLI, set its value to `secretref:`, followed by the name of the secret.
Here, the environment variable named `connection-string` gets its value from the application-level `queue-connection-string` secret by using `secretref`.
139
+
Here, the environment variable named `connection-string` gets its value from the application-level `queue-connection-string` secret.
0 commit comments