Skip to content

Commit 889f4b2

Browse files
authored
Merge pull request #228120 from anthonychu/aca/storage-ga
[Container Apps] Update storage mount docs and remove preview
2 parents 961b6b7 + 6077090 commit 889f4b2

File tree

3 files changed

+125
-40
lines changed

3 files changed

+125
-40
lines changed

articles/container-apps/azure-resource-manager-api-spec.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,20 @@ properties:
441441
value: "startup probe"
442442
initialDelaySeconds: 3
443443
periodSeconds: 3
444+
volumeMounts:
445+
- mountPath: /myempty
446+
volumeName: myempty
447+
- mountPath: /myfiles
448+
volumeName: azure-files-volume
444449
scale:
445450
minReplicas: 1
446451
maxReplicas: 3
452+
volumes:
453+
- name: myempty
454+
storageType: EmptyDir
455+
- name: azure-files-volume
456+
storageType: AzureFile
457+
storageName: myazurefiles
447458
```
448459
449460
---

articles/container-apps/storage-mounts-azure-files.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Tutorial: Create an Azure Files storage mount in Azure Container Apps"
2+
title: "Tutorial: Create an Azure Files volume mount in Azure Container Apps"
33
description: Learn to create an Azure Files storage mount in Azure Container Apps
44
services: container-apps
55
author: craigshoemaker
@@ -10,12 +10,9 @@ ms.date: 07/19/2022
1010
ms.author: cshoe
1111
---
1212

13-
# Tutorial: Create an Azure Files storage mount in Azure Container Apps
13+
# Tutorial: Create an Azure Files volume mount in Azure Container Apps
1414

15-
Learn to write to permanent storage in a container app using an Azure Files storage mount.
16-
17-
> [!NOTE]
18-
> The volume mounting features in Azure Container Apps are in preview.
15+
Learn to write to permanent storage in a container app using an Azure Files storage mount. For more information about storage mounts, see [Use storage mounts in Azure Container Apps](storage-mounts.md).
1916

2017
In this tutorial, you learn how to:
2118

articles/container-apps/storage-mounts.md

Lines changed: 111 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ services: container-apps
55
author: craigshoemaker
66
ms.service: container-apps
77
ms.topic: conceptual
8-
ms.date: 05/13/2022
8+
ms.date: 02/21/2023
99
ms.author: cshoe
10-
zone_pivot_groups: container-apps-config-types
10+
zone_pivot_groups: arm-azure-cli-portal
1111
---
1212

1313
# Use storage mounts in Azure Container Apps
@@ -17,12 +17,9 @@ A container app has access to different types of storage. A single app can take
1717
| Storage type | Description | Usage examples |
1818
|--|--|--|
1919
| [Container file system](#container-file-system) | Temporary storage scoped to the local container | Writing a local app cache. |
20-
| [Temporary storage](#temporary-storage) | Temporary storage scoped to an individual replica | Sharing files between containers in a replica. For instance, the main app container can write log files that are processed by a sidecar container. |
20+
| [Ephemeral storage](#temporary-storage) | Temporary storage scoped to an individual replica | Sharing files between containers in a replica. For instance, the main app container can write log files that are processed by a sidecar container. |
2121
| [Azure Files](#azure-files) | Permanent storage | Writing files to a file share to make data accessible by other systems. |
2222

23-
> [!NOTE]
24-
> The volume mounting features in Azure Container Apps are in preview.
25-
2623
## Container file system
2724

2825
A container can write to its own file system.
@@ -33,19 +30,26 @@ Container file system storage has the following characteristics:
3330
* Files written to this storage are only visible to processes running in the current container.
3431
* There are no capacity guarantees. The available storage depends on the amount of disk space available in the container.
3532

36-
## Temporary storage
33+
## <a name="temporary-storage"></a>Ephemeral volume
3734

38-
You can mount an ephemeral volume that is equivalent to [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) in Kubernetes. Temporary storage is scoped to a single replica.
35+
You can mount an ephemeral, temporary volume that is equivalent to [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) in Kubernetes. Ephemeral storage is scoped to a single replica.
3936

40-
Temporary storage has the following characteristics:
37+
Ephemeral storage has the following characteristics:
4138

4239
* Files are persisted for the lifetime of the replica.
4340
* If a container in a replica restarts, the files in the volume remain.
4441
* Any containers in the replica can mount the same volume.
45-
* A container can mount multiple temporary volumes.
46-
* There are no capacity guarantees. The available storage depends on the amount of disk space available in the replica.
42+
* A container can mount multiple ephemeral volumes.
43+
* The available storage depends on the total amount of vCPUs allocated to the replica.
44+
45+
| vCPUs | Ephemeral storage |
46+
|--|--|
47+
| Up to 0.25 | 1 GiB |
48+
| Up to 0.5 | 2 GiB |
49+
| Up to 1 | 4 GiB |
50+
| Over 1 | 8 GiB |
4751

48-
To configure temporary storage, first define an `EmptyDir` volume in the revision. Then define a volume mount in one or more containers in the revision.
52+
To configure ephemeral storage, first define an `EmptyDir` volume in the revision. Then define a volume mount in one or more containers in the revision.
4953

5054
### Prerequisites
5155

@@ -56,22 +60,22 @@ To configure temporary storage, first define an `EmptyDir` volume in the revisio
5660

5761
### Configuration
5862

59-
::: zone pivot="aca-cli"
63+
::: zone pivot="azure-cli"
6064

61-
When using temporary storage, you must use the Azure CLI with a YAML definition to create or update your container app.
65+
When configuring ephemeral storage using the Azure CLI, you must use a YAML definition to create or update your container app.
6266

63-
1. To update an existing container app to use temporary storage, export your app's specification to a YAML file named *app.yaml*.
67+
1. To update an existing container app to use ephemeral storage, export your app's specification to a YAML file named *app.yaml*.
6468

6569
```azure-cli
6670
az containerapp show -n <APP_NAME> -g <RESOURCE_GROUP_NAME> -o yaml > app.yaml
6771
```
6872
6973
1. Make the following changes to your container app specification.
7074
71-
- Add a `volumes` array to the `template` section of your container app definition and define a volume.
75+
- Add a `volumes` array to the `template` section of your container app definition and define a volume. If you already have a `volumes` array, add a new volume to the array.
7276
- The `name` is an identifier for the volume.
7377
- Use `EmptyDir` as the `storageType`.
74-
- For each container in the template that you want to mount temporary storage, add a `volumeMounts` array to the container definition and define a volume mount.
78+
- For each container in the template that you want to mount the ephemeral volume, define a volume mount in the `volumeMounts` array of the container definition.
7579
- The `volumeName` is the name defined in the `volumes` array.
7680
- The `mountPath` is the path in the container to mount the volume.
7781
@@ -99,16 +103,18 @@ When using temporary storage, you must use the Azure CLI with a YAML definition
99103
--yaml app.yaml
100104
```
101105
106+
See the [YAML specification](azure-resource-manager-api-spec.md?tabs=yaml) for a full example.
107+
102108
::: zone-end
103109
104-
::: zone pivot="aca-arm"
110+
::: zone pivot="azure-resource-manager"
105111
106-
To create a temporary volume and mount it in a container, make the following changes to the container apps resource in an ARM template:
112+
To create an ephemeral volume and mount it in a container, make the following changes to the container apps resource in an ARM template:
107113
108-
- Add a `volumes` array to the `template` section of your container app definition and define a volume.
114+
- Add a `volumes` array to the `template` section of your container app definition and define a volume. If you already have a `volumes` array, add a new volume to the array.
109115
- The `name` is an identifier for the volume.
110116
- Use `EmptyDir` as the `storageType`.
111-
- For each container in the template that you want to mount temporary storage, add a `volumeMounts` array to the container definition and define a volume mount.
117+
- For each container in the template that you want to mount temporary storage, define a volume mount in the `volumeMounts` array of the container definition.
112118
- The `volumeName` is the name defined in the `volumes` array.
113119
- The `mountPath` is the path in the container to mount the volume.
114120
@@ -161,11 +167,35 @@ See the [ARM template API specification](azure-resource-manager-api-spec.md) for
161167

162168
::: zone-end
163169

164-
## Azure Files
165170

166-
You can mount a file share from [Azure Files](../storage/files/index.yml) as a volume inside a container.
171+
::: zone pivot="azure-portal"
167172

168-
For a step-by-step tutorial, refer to [Create an Azure Files storage mount in Azure Container Apps](storage-mounts-azure-files.md).
173+
To create an ephemeral volume and mount it in a container, deploy a new revision of your container app using the Azure portal.
174+
175+
1. In the Azure portal, navigate to your container app.
176+
177+
1. Select **Revision management** in the left menu.
178+
179+
1. Select **Create new revision**.
180+
181+
1. Select the container where you want to mount the volume.
182+
183+
1. In the *Edit a container* context pane, select the **Volume mounts** tab.
184+
185+
1. Under the *Ephemeral storage* section, create a new volume with the following information.
186+
187+
- **Volume name**: A name for the ephemeral volume.
188+
- **Mount path**: The absolute path in the container to mount the volume.
189+
190+
1. Select **Save** to save changes and exit the context pane.
191+
192+
1. Select **Create** to create the new revision.
193+
194+
::: zone-end
195+
196+
## <a name="azure-files"></a>Azure Files volume
197+
198+
You can mount a file share from [Azure Files](../storage/files/index.yml) as a volume in a container.
169199

170200
Azure Files storage has the following characteristics:
171201

@@ -177,8 +207,8 @@ Azure Files storage has the following characteristics:
177207

178208
To enable Azure Files storage in your container, you need to set up your container in the following ways:
179209

180-
* Create a storage definition of type `AzureFile` in the Container Apps environment.
181-
* Define a storage volume in a revision.
210+
* Create a storage definition in the Container Apps environment.
211+
* Define a volume of type `AzureFile` in a revision.
182212
* Define a volume mount in one or more containers in the revision.
183213

184214
#### Prerequisites
@@ -191,11 +221,13 @@ To enable Azure Files storage in your container, you need to set up your contain
191221

192222
### Configuration
193223

194-
::: zone pivot="aca-cli"
224+
::: zone pivot="azure-cli"
195225

196-
When using Azure Files, you must use the Azure CLI with a YAML definition to create or update your container app.
226+
When configuring a container app to mount an Azure Files volume using the Azure CLI, you must use a YAML definition to create or update your container app.
197227

198-
1. Add a storage definition of type `AzureFile` to your Container Apps environment.
228+
For a step-by-step tutorial, refer to [Create an Azure Files storage mount in Azure Container Apps](storage-mounts-azure-files.md).
229+
230+
1. Add a storage definition to your Container Apps environment.
199231

200232
```azure-cli
201233
az containerapp env storage set --name my-env --resource-group my-group \
@@ -218,11 +250,11 @@ When using Azure Files, you must use the Azure CLI with a YAML definition to cre
218250
219251
1. Make the following changes to your container app specification.
220252
221-
- Add a `volumes` array to the `template` section of your container app definition and define a volume.
253+
- Add a `volumes` array to the `template` section of your container app definition and define a volume. If you already have a `volumes` array, add a new volume to the array.
222254
- The `name` is an identifier for the volume.
223255
- For `storageType`, use `AzureFile`.
224256
- For `storageName`, use the name of the storage you defined in the environment.
225-
- For each container in the template that you want to mount Azure Files storage, add a `volumeMounts` array to the container definition and define a volume mount.
257+
- For each container in the template that you want to mount Azure Files storage, define a volume mount in the `volumeMounts` array of the container definition.
226258
- The `volumeName` is the name defined in the `volumes` array.
227259
- The `mountPath` is the path in the container to mount the volume.
228260
@@ -250,9 +282,11 @@ When using Azure Files, you must use the Azure CLI with a YAML definition to cre
250282
--yaml app.yaml
251283
```
252284
285+
See the [YAML specification](azure-resource-manager-api-spec.md?tabs=yaml) for a full example.
286+
253287
::: zone-end
254288
255-
::: zone pivot="aca-arm"
289+
::: zone pivot="azure-resource-manager"
256290
257291
The following ARM template snippets demonstrate how to add an Azure Files share to a Container Apps environment and use it in a container app.
258292
@@ -341,14 +375,57 @@ The following ARM template snippets demonstrate how to add an Azure Files share
341375
}
342376
```
343377
344-
- Add a `volumes` array to the `template` section of your container app definition and define a volume.
378+
- Add a `volumes` array to the `template` section of your container app definition and define a volume. If you already have a `volumes` array, add a new volume to the array.
345379
- The `name` is an identifier for the volume.
346380
- For `storageType`, use `AzureFile`.
347381
- For `storageName`, use the name of the storage you defined in the environment.
348-
- For each container in the template that you want to mount Azure Files storage, add a `volumeMounts` array to the container definition and define a volume mount.
382+
- For each container in the template that you want to mount Azure Files storage, define a volume mount in the `volumeMounts` array of the container definition.
349383
- The `volumeName` is the name defined in the `volumes` array.
350384
- The `mountPath` is the path in the container to mount the volume.
351385
352386
See the [ARM template API specification](azure-resource-manager-api-spec.md) for a full example.
353387
354388
::: zone-end
389+
390+
::: zone pivot="azure-portal"
391+
392+
To configure a volume mount for Azure Files storage in the Azure portal, add a file share to your Container Apps environment and then add a volume mount to your container app by creating a new revision.
393+
394+
1. In the Azure portal, navigate to your Container Apps environment.
395+
396+
1. Select **Azure Files** from the left menu.
397+
398+
1. Select **Add**.
399+
400+
1. In the *Add file share* context menu, enter the following information:
401+
402+
- **Name**: A name for the file share.
403+
- **Storage account name**: The name of the storage account that contains the file share.
404+
- **Storage account key**: The access key for the storage account.
405+
- **File share**: The name of the file share.
406+
- **Access mode**: The access mode for the file share. Valid values are "Read/Write" and "Read only".
407+
408+
1. Select **Add** to exit the context pane.
409+
410+
1. Select **Save** to commit the changes.
411+
412+
1. Navigate to your container app.
413+
414+
1. Select **Revision management** from the left menu.
415+
416+
1. Select **Create new revision**.
417+
418+
1. Select the container that you want to mount the volume in.
419+
420+
1. In the *Edit a container* context pane, select the **Volume mounts** tab.
421+
422+
1. Under the *File shares* section, create a new volume with the following information.
423+
424+
- **File share name**: The file share you added.
425+
- **Mount path**: The absolute path in the container to mount the volume.
426+
427+
1. Select **Save** to save changes and exit the context pane.
428+
429+
1. Select **Create** to create the new revision.
430+
431+
::: zone-end

0 commit comments

Comments
 (0)