Skip to content

Commit 9fec67d

Browse files
committed
[ACI] Secret vol update
1 parent eddaae3 commit 9fec67d

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

articles/container-instances/container-instances-volume-secret.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
title: Mount secret volume to container group
33
description: Learn how to mount a secret volume to store sensitive information for access by your container instances
44
ms.topic: article
5-
ms.date: 07/19/2018
5+
ms.date: 04/03/2020
66
---
77

88
# Mount a secret volume in Azure Container Instances
99

1010
Use a *secret* volume to supply sensitive information to the containers in a container group. The *secret* volume stores your secrets in files within the volume, accessible by the containers in the container group. By storing secrets in a *secret* volume, you can avoid adding sensitive data like SSH keys or database credentials to your application code.
1111

12-
All *secret* volumes are backed by [tmpfs][tmpfs], a RAM-backed filesystem; their contents are never written to non-volatile storage.
12+
* Once deployed with secrets in a container group, a secret volume is *read-only*.
13+
* All secret volumes are backed by [tmpfs][tmpfs], a RAM-backed filesystem; their contents are never written to non-volatile storage.
1314

1415
> [!NOTE]
1516
> *Secret* volumes are currently restricted to Linux containers. Learn how to pass secure environment variables for both Windows and Linux containers in [Set environment variables](container-instances-environment-variables.md). While we're working to bring all features to Windows containers, you can find current platform differences in the [overview](container-instances-overview.md#linux-and-windows-containers).
1617
1718
## Mount secret volume - Azure CLI
1819

19-
To deploy a container with one or more secrets by using the Azure CLI, include the `--secrets` and `--secrets-mount-path` parameters in the [az container create][az-container-create] command. This example mounts a *secret* volume consisting of two secrets, "mysecret1" and "mysecret2," at `/mnt/secrets`:
20+
To deploy a container with one or more secrets by using the Azure CLI, include the `--secrets` and `--secrets-mount-path` parameters in the [az container create][az-container-create] command. This example mounts a *secret* volume consisting of two files containing secrets, "mysecret1" and "mysecret2," at `/mnt/secrets`:
2021

2122
```azurecli-interactive
2223
az container create \
@@ -30,11 +31,13 @@ az container create \
3031
The following [az container exec][az-container-exec] output shows opening a shell in the running container, listing the files within the secret volume, then displaying their contents:
3132

3233
```azurecli
33-
az container exec --resource-group myResourceGroup --name secret-volume-demo --exec-command "/bin/sh"
34+
az container exec \
35+
--resource-group myResourceGroup \
36+
--name secret-volume-demo --exec-command "/bin/sh"
3437
```
3538

3639
```output
37-
/usr/src/app # ls -1 /mnt/secrets
40+
/usr/src/app # ls /mnt/secrets
3841
mysecret1
3942
mysecret2
4043
/usr/src/app # cat /mnt/secrets/mysecret1
@@ -51,7 +54,7 @@ You can also deploy container groups with the Azure CLI and a [YAML template](co
5154

5255
When you deploy with a YAML template, the secret values must be **Base64-encoded** in the template. However, the secret values appear in plaintext within the files in the container.
5356

54-
The following YAML template defines a container group with one container that mounts a *secret* volume at `/mnt/secrets`. The secret volume has two secrets, "mysecret1" and "mysecret2."
57+
The following YAML template defines a container group with one container that mounts a *secret* volume at `/mnt/secrets`. The secret volume has two files containing secrets, "mysecret1" and "mysecret2."
5558

5659
```yaml
5760
apiVersion: '2018-10-01'
@@ -86,7 +89,9 @@ To deploy with the YAML template, save the preceding YAML to a file named `deplo
8689

8790
```azurecli-interactive
8891
# Deploy with YAML template
89-
az container create --resource-group myResourceGroup --file deploy-aci.yaml
92+
az container create \
93+
--resource-group myResourceGroup \
94+
--file deploy-aci.yaml
9095
```
9196

9297
## Mount secret volume - Resource Manager
@@ -102,11 +107,13 @@ The following Resource Manager template defines a container group with one conta
102107
<!-- https://github.com/Azure/azure-docs-json-samples/blob/master/container-instances/aci-deploy-volume-secret.json -->
103108
[!code-json[volume-secret](~/azure-docs-json-samples/container-instances/aci-deploy-volume-secret.json)]
104109

105-
To deploy with the Resource Manager template, save the preceding JSON to a file named `deploy-aci.json`, then execute the [az group deployment create][az-group-deployment-create] command with the `--template-file` parameter:
110+
To deploy with the Resource Manager template, save the preceding JSON to a file named `deploy-aci.json`, then execute the [az deployment group create][az-deployment-group-create] command with the `--template-file` parameter:
106111

107112
```azurecli-interactive
108113
# Deploy with Resource Manager template
109-
az group deployment create --resource-group myResourceGroup --template-file deploy-aci.json
114+
az deployment group create \
115+
--resource-group myResourceGroup \
116+
--template-file deploy-aci.json
110117
```
111118

112119
## Next steps
@@ -129,4 +136,4 @@ Another method for providing sensitive information to containers (including Wind
129136
<!-- LINKS - Internal -->
130137
[az-container-create]: /cli/azure/container#az-container-create
131138
[az-container-exec]: /cli/azure/container#az-container-exec
132-
[az-group-deployment-create]: /cli/azure/group/deployment#az-group-deployment-create
139+
[az-deployment-group-create]: /cli/azure/deployment/group#az-deployment-group-create

0 commit comments

Comments
 (0)