Skip to content

Commit 3b5b4b0

Browse files
authored
Merge pull request #99376 from dlepow/acifresh4
[ACI freshness] Update Azure files article
2 parents 5316de0 + f764c40 commit 3b5b4b0

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

articles/container-instances/container-instances-volume-azure-files.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
title: Mount Azure Files volume to container group
33
description: Learn how to mount an Azure Files volume to persist state with Azure Container Instances
44
ms.topic: article
5-
ms.date: 07/08/2019
5+
ms.date: 12/30/2019
66
ms.custom: mvc
77
---
88

99
# Mount an Azure file share in Azure Container Instances
1010

11-
By default, Azure Container Instances are stateless. If the container crashes or stops, all of its state is lost. To persist state beyond the lifetime of the container, you must mount a volume from an external store. As shown in this article, Azure Container Instances can mount an Azure file share created with [Azure Files](../storage/files/storage-files-introduction.md). Azure Files offers fully managed file shares in the cloud that are accessible via the industry standard Server Message Block (SMB) protocol. Using an Azure file share with Azure Container Instances provides file-sharing features similar to using an Azure file share with Azure virtual machines.
11+
By default, Azure Container Instances are stateless. If the container crashes or stops, all of its state is lost. To persist state beyond the lifetime of the container, you must mount a volume from an external store. As shown in this article, Azure Container Instances can mount an Azure file share created with [Azure Files](../storage/files/storage-files-introduction.md). Azure Files offers fully managed file shares hosted in Azure Storage that are accessible via the industry standard Server Message Block (SMB) protocol. Using an Azure file share with Azure Container Instances provides file-sharing features similar to using an Azure file share with Azure virtual machines.
1212

1313
> [!NOTE]
1414
> Mounting an Azure Files share is currently restricted to Linux containers. Find current platform differences in the [overview](container-instances-overview.md#linux-and-windows-containers).
@@ -35,29 +35,33 @@ az storage account create \
3535
--sku Standard_LRS
3636
3737
# Create the file share
38-
az storage share create --name $ACI_PERS_SHARE_NAME --account-name $ACI_PERS_STORAGE_ACCOUNT_NAME
38+
az storage share create \
39+
--name $ACI_PERS_SHARE_NAME \
40+
--account-name $ACI_PERS_STORAGE_ACCOUNT_NAME
3941
```
4042

4143
## Get storage credentials
4244

4345
To mount an Azure file share as a volume in Azure Container Instances, you need three values: the storage account name, the share name, and the storage access key.
4446

45-
If you used the script above, the storage account name was stored in the $ACI_PERS_STORAGE_ACCOUNT_NAME variable. To see the account name, type:
47+
* **Storage account name** - If you used the preceding script, the storage account name was stored in the `$ACI_PERS_STORAGE_ACCOUNT_NAME` variable. To see the account name, type:
4648

47-
```console
48-
echo $ACI_PERS_STORAGE_ACCOUNT_NAME
49-
```
49+
```console
50+
echo $ACI_PERS_STORAGE_ACCOUNT_NAME
51+
```
5052

51-
The share name is already known (defined as *acishare* in the script above), so all that remains is the storage account key, which can be found using the following command:
53+
* **Share name** - This value is already known (defined as `acishare` in the preceding script)
5254

53-
```azurecli-interactive
54-
STORAGE_KEY=$(az storage account keys list --resource-group $ACI_PERS_RESOURCE_GROUP --account-name $ACI_PERS_STORAGE_ACCOUNT_NAME --query "[0].value" --output tsv)
55-
echo $STORAGE_KEY
56-
```
55+
* **Storage account key** - This value can be found using the following command:
56+
57+
```azurecli-interactive
58+
STORAGE_KEY=$(az storage account keys list --resource-group $ACI_PERS_RESOURCE_GROUP --account-name $ACI_PERS_STORAGE_ACCOUNT_NAME --query "[0].value" --output tsv)
59+
echo $STORAGE_KEY
60+
```
5761

5862
## Deploy container and mount volume - CLI
5963

60-
To mount an Azure file share as a volume in a container by using the Azure CLI, specify the share and volume mount point when you create the container with [az container create][az-container-create]. If you've followed the previous steps, you can mount the share you created earlier by using the following command to create a container:
64+
To mount an Azure file share as a volume in a container by using the Azure CLI, specify the share and volume mount point when you create the container with [az container create][az-container-create]. If you followed the previous steps, you can mount the share you created earlier by using the following command to create a container:
6165

6266
```azurecli-interactive
6367
az container create \
@@ -79,14 +83,15 @@ The `--dns-name-label` value must be unique within the Azure region where you cr
7983
Once the container starts up, you can use the simple web app deployed via the Microsoft [aci-hellofiles][aci-hellofiles] image to create small text files in the Azure file share at the mount path you specified. Obtain the web app's fully qualified domain name (FQDN) with the [az container show][az-container-show] command:
8084

8185
```azurecli-interactive
82-
az container show --resource-group $ACI_PERS_RESOURCE_GROUP --name hellofiles --query ipAddress.fqdn --output tsv
86+
az container show --resource-group $ACI_PERS_RESOURCE_GROUP \
87+
--name hellofiles --query ipAddress.fqdn --output tsv
8388
```
8489

85-
After saving text using the app, you can use the [Azure portal][portal] or a tool like the [Microsoft Azure Storage Explorer][storage-explorer] to retrieve and inspect the file written to the file share.
90+
After saving text using the app, you can use the [Azure portal][portal] or a tool like the [Microsoft Azure Storage Explorer][storage-explorer] to retrieve and inspect the file or files written to the file share.
8691

8792
## Deploy container and mount volume - YAML
8893

89-
You can also deploy a container group and mount a volume in a container with the Azure CLI and a [YAML template](container-instances-multi-container-yaml.md). Deploying by YAML template is the preferred method when deploying container groups consisting of multiple containers.
94+
You can also deploy a container group and mount a volume in a container with the Azure CLI and a [YAML template](container-instances-multi-container-yaml.md). Deploying by YAML template is a preferred method when deploying container groups consisting of multiple containers.
9095

9196
The following YAML template defines a container group with one container created with the `aci-hellofiles` image. The container mounts the Azure file share *acishare* created previously as a volume. Where indicated, enter the name and storage key for the storage account that hosts the file share.
9297

@@ -223,7 +228,7 @@ az group deployment create --resource-group myResourceGroup --template-file depl
223228

224229
## Mount multiple volumes
225230

226-
To mount multiple volumes in a container instance, you must deploy using an [Azure Resource Manager template](/azure/templates/microsoft.containerinstance/containergroups) or a YAML file. To use a template or YAML file, provide the share details and define the volumes by populating the `volumes` array in the `properties` section of the template.
231+
To mount multiple volumes in a container instance, you must deploy using an [Azure Resource Manager template](/azure/templates/microsoft.containerinstance/containergroups), a YAML file, or another programmatic method. To use a template or YAML file, provide the share details and define the volumes by populating the `volumes` array in the `properties` section of the file.
227232

228233
For example, if you created two Azure Files shares named *share1* and *share2* in storage account *myStorageAccount*, the `volumes` array in a Resource Manager template would appear similar to the following:
229234

0 commit comments

Comments
 (0)