Skip to content

Commit 2d4bae8

Browse files
committed
Fix typos and improve content readability
- Separated the Azure CLI sample with a secret and non-secret example - Added an introduction to the Adding environment variables on existing container apps section - Added spaces in-between images - Fixed a typo
1 parent d301b33 commit 2d4bae8

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

articles/container-apps/environment-variables.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,20 @@ If you're creating a new Container App through the [Azure portal](https://portal
2828

2929
You can create your Container App with enviroment variables using the [az containerapp create](/cli/azure/containerapp#az-containerapp-create) command by passing the environment variables as space-separated 'key=value' entries using the `--env-vars` parameter.
3030

31-
If you want to reference a secret, you have to ensure that the secret you want to reference is already created, see [Manage secrets](manage-secrets.md). You can use the secret name and pass it to the value field but starting with `secretref:`
32-
3331
```azurecli
3432
az containerapp create -n my-containerapp -g MyResourceGroup \
3533
--image my-app:v1.0 --environment MyContainerappEnv \
3634
--secrets mysecret=secretvalue1 anothersecret="secret value 2" \
37-
--env-vars GREETING="Hello, world" SECRETENV=secretref:anothersecret
35+
--env-vars GREETING="Hello, world" ANOTHERENV=anotherenv
36+
```
37+
38+
If you want to reference a secret, you have to ensure that the secret you want to reference is already created, see [Manage secrets](manage-secrets.md). You can use the secret name and pass it to the value field but starting with `secretref:`
39+
40+
```azurecli
41+
az containerapp update \
42+
-n <APP NAME>
43+
-g <RESOURCE_GROUP_NAME>
44+
--set-env-vars <VAR_NAME>=secretref:<SECRET_NAME>
3845
```
3946

4047
### [PowerShell](#tab/powershell)
@@ -76,6 +83,8 @@ Update-AzContainerApp -TemplateContainer $containerTemplate
7683

7784
## Adding environment variables on existing container apps
7885

86+
After the Container App is created, the only way to update the Container App environment variables is by creating a new revision with the needed changes.
87+
7988
### [Azure portal](#tab/portal)
8089

8190
1. In the [Azure portal](https://portal.azure.com), search for Container Apps and then select your app.
@@ -88,7 +97,9 @@ Update-AzContainerApp -TemplateContainer $containerTemplate
8897

8998
1. Then set the Name of your Environment variable and the Source (it can be a reference to a [secret](manage-secrets.md)).
9099
:::image type="content" source="media/environment-variables/secret-env-var.png" alt-text="Screenshot of Container App Revision container image environment settings section.":::
100+
91101
1. If you select the Source as manual, you can manually input the Environment variable value.
102+
92103
:::image type="content" source="media/environment-variables/manual-env-var.png" alt-text="Screenshot of Container App Revision container image environment settings section with one of the environments source selected as Manual.":::
93104

94105
### [Azure CLI](#tab/cli)
@@ -106,7 +117,7 @@ az containerapp update \
106117

107118
If you want to create multiple environment variables, you can insert space-separated values in the 'key=value' format.
108119

109-
If you want to reference a secret, you have to ensure that the secret you want to reference is already created, see [Manage secrets](manage-secrets.md). You can use the secret name and pass it to the value field but starting with `secretref:`, see the following image:
120+
If you want to reference a secret, you have to ensure that the secret you want to reference is already created, see [Manage secrets](manage-secrets.md). You can use the secret name and pass it to the value field but starting with `secretref:`, see the following example:
110121

111122
```azurecli
112123
az containerapp update \

0 commit comments

Comments
 (0)