|
2 | 2 | author: msangapu-msft
|
3 | 3 | ms.service: app-service
|
4 | 4 | ms.topic: include
|
5 |
| -ms.date: 08/24/2023 |
| 5 | +ms.date: 01/05/2024 |
6 | 6 | ms.author: msangapu
|
7 | 7 | ---
|
8 | 8 |
|
9 | 9 | > [!NOTE]
|
10 |
| -> You can also [configure Azure Storage in an ARM template](https://github.com/Azure/app-service-linux-docs/blob/master/BringYourOwnStorage/BYOS_azureFiles.json). |
| 10 | +> [NFS](../../../storage/files/files-nfs-protocol.md) support is now available for App Service on Linux. |
11 | 11 | >
|
12 | 12 |
|
13 |
| -This guide shows how to mount Azure Storage as a network share in a built-in Linux container or a custom Linux container in App Service. Azure Storage is Microsoft's cloud storage solution for modern data storage scenarios. Azure Storage offers highly available, massively scalable, durable, and secure storage for a variety of data objects in the cloud. Azure Storage is non-default storage for App Service and billed separately. |
| 13 | +This guide shows how to mount Azure Storage as a network share in a built-in Linux container or a custom Linux container in App Service. Azure Storage is Microsoft's cloud storage solution for modern data storage scenarios. Azure Storage offers highly available, massively scalable, durable, and secure storage for a variety of data objects in the cloud. Azure Storage is non-default storage for App Service and billed separately. You can also [configure Azure Storage in an ARM template](https://github.com/Azure/app-service-linux-docs/blob/master/BringYourOwnStorage/BYOS_azureFiles.json). |
| 14 | + |
| 15 | + |
| 16 | +### Benefits |
14 | 17 |
|
15 | 18 | The benefits of custom-mounted storage include:
|
16 | 19 | - Configure persistent storage for your App Service app and manage the storage separately.
|
17 | 20 | - Make static content like video and images readily available for your App Service app.
|
18 | 21 | - Write application log files or archive older application log to Azure File shares.
|
19 | 22 | - Share content across multiple apps or with other Azure services.
|
| 23 | +- Azure Files [NFS](../../../storage/files/files-nfs-protocol.md) and Azure Files [SMB](../../../storage/files/files-smb-protocol.md) are supported. |
| 24 | +- Azure Blobs (read-only) are supported. |
| 25 | +- Up to five mount points per app are supported. |
| 26 | + |
| 27 | +### Limitations |
| 28 | + |
| 29 | +The limitations of custom-mounted storage include: |
| 30 | +- [Storage firewall](../../../storage/common/storage-network-security.md) is supported only through [service endpoints](../../../storage/common/storage-network-security.md#grant-access-from-a-virtual-network) and [private endpoints](../../../storage/common/storage-private-endpoints.md) (when [VNET integration](../../overview-vnet-integration.md) is used). |
| 31 | +- FTP/FTPS access to custom-mounted storage isn't supported (use [Azure Storage Explorer](https://azure.microsoft.com/features/storage-explorer/)). |
| 32 | +- Azure CLI, Azure PowerShell, and Azure SDK support is in preview. |
| 33 | +- Mapping `/` or `/home` to custom-mounted storage isn't supported. |
| 34 | +- Don't map the storage mount to `/tmp` or its subdirectories as this action may cause a timeout during app startup. |
| 35 | +- Azure Storage isn't supported with [Docker Compose](../../configure-custom-container.md?pivots=container-linux#docker-compose-options) scenarios. |
| 36 | +- Storage mounts aren't included in [backups](../../manage-backup.md). Be sure to follow best practices to back up the Azure Storage accounts. |
| 37 | +- NFS support is only available for App Service on Linux. NFS isn't supported for Windows code and Windows containers. The web app and storage account need to be configured on the same VNET for NFS. The storage account used for file share should have "Premium" performance tier and "Filestorage" as the Account Kind. Azure Key Vault is not applicable when using the NFS protocol. |
| 38 | +- With VNET integration on your app, the mounted drive uses an RFC1918 IP address and not an IP address from your VNET. |
20 | 39 |
|
21 |
| -The following features are supported for Linux containers: |
22 |
| -- Azure Files (read/write). |
23 |
| -- Azure Blobs (read-only). |
24 |
| -- Up to five mount points per app. |
25 | 40 |
|
26 |
| -Here are the three options to mount Azure storage to your app: |
| 41 | +### Mounting options |
| 42 | + |
| 43 | +You first need to mount the storage to the app. Here are three mounting options for Azure storage: |
27 | 44 |
|
28 | 45 | | Mounting option | Usage |
|
29 | 46 | |--------------------------|-------------|
|
@@ -54,21 +71,8 @@ Here are the three options to mount Azure storage to your app:
|
54 | 71 |
|
55 | 72 | ---
|
56 | 73 |
|
57 |
| -## Limitations |
58 |
| - |
59 |
| -- [Storage firewall](../../../storage/common/storage-network-security.md) is supported only through [service endpoints](../../../storage/common/storage-network-security.md#grant-access-from-a-virtual-network) and [private endpoints](../../../storage/common/storage-private-endpoints.md) (when [VNET integration](../../overview-vnet-integration.md) is used). |
60 |
| -- FTP/FTPS access to custom-mounted storage isn't supported (use [Azure Storage Explorer](https://azure.microsoft.com/features/storage-explorer/)). |
61 |
| -- Azure CLI, Azure PowerShell, and Azure SDK support is in preview. |
62 |
| -- Mapping `/` or `/home` to custom-mounted storage isn't supported. |
63 |
| -- Don't map the storage mount to `/tmp` or its subdirectories as this action may cause a timeout during app startup. |
64 |
| -- Azure Storage isn't supported with [Docker Compose](../../configure-custom-container.md?pivots=container-linux#docker-compose-options) scenarios. |
65 |
| -- Storage mounts aren't included in [backups](../../manage-backup.md). Be sure to follow best practices to back up the Azure Storage accounts. |
66 |
| -- Azure Files [NFS](../../../storage/files/files-nfs-protocol.md) is currently unsupported for App Service on Linux. Only Azure Files [SMB](../../../storage/files/files-smb-protocol.md) are supported. |
67 |
| -- With VNET integration on your app, the mounted drive uses an RFC1918 IP address and not an IP address from your VNET. |
68 |
| - |
69 | 74 | ## Prepare for mounting
|
70 | 75 |
|
71 |
| - |
72 | 76 | ### [Basic](#tab/basic)
|
73 | 77 |
|
74 | 78 | No extra steps are required because the portal gets and stores the access key for you.
|
@@ -201,32 +205,26 @@ To validate that the Azure Storage is mounted successfully for the app:
|
201 | 205 |
|
202 | 206 | ## Best practices
|
203 | 207 |
|
| 208 | +#### Performance |
204 | 209 | - To avoid latency issues, place the app and the Azure Storage account in the same region. If you grant access from App Service IP addresses in the [Azure Storage firewall configuration](../../../storage/common/storage-network-security.md) when the app and Azure Storage account are in the same region, then these IP restrictions aren't honored.
|
| 210 | +- The mounted Azure Storage account can be either Standard or Premium performance tier. Based on the app capacity and throughput requirements, choose the appropriate performance tier for the storage account. See the scalability and performance targets that correspond to the storage type: [Files](../../../storage/files/storage-files-scale-targets.md) and [Blobs](../../../storage/blobs/scalability-targets.md). |
205 | 211 |
|
206 |
| -- The mount directory in the custom container should be empty. Any content stored at this path is deleted when the Azure Storage is mounted (if you specify a directory under `/home`, for example). If you are migrating files for an existing app, make a backup of the app and its content before you begin. |
| 212 | +- If your app [scales to multiple instances](../../../azure-monitor/autoscale/autoscale-get-started.md), all the instances connect to the same mounted Azure Storage account. To avoid performance bottlenecks and throughput issues, choose the appropriate performance tier for the storage account. |
207 | 213 |
|
| 214 | +#### Security |
208 | 215 | - In the Azure Storage account, avoid [regenerating the access key](../../../storage/common/storage-account-keys-manage.md) that's used to mount the storage in the app. The storage account contains two different keys. Azure App Services stores Azure storage account key. Use a stepwise approach to ensure that the storage mount remains available to the app during key regeneration. For example, assuming that you used **key1** to configure storage mount in your app:
|
209 |
| - |
210 |
| - 1. Regenerate **key2**. |
| 216 | + 1. Regenerate **key2**. |
211 | 217 | 1. In the storage mount configuration, update the access the key to use the regenerated **key2**.
|
212 | 218 | 1. Regenerate **key1**.
|
213 | 219 |
|
214 |
| -- If you delete an Azure Storage account, container, or share, remove the corresponding storage mount configuration in the app to avoid possible error scenarios. |
215 |
| - |
216 |
| -- The mounted Azure Storage account can be either Standard or Premium performance tier. Based on the app capacity and throughput requirements, choose the appropriate performance tier for the storage account. See the scalability and performance targets that correspond to the storage type: |
217 |
| - |
218 |
| - - [For Files](../../../storage/files/storage-files-scale-targets.md) |
219 |
| - - [For Blobs](../../../storage/blobs/scalability-targets.md) |
| 220 | +#### Troubleshooting |
220 | 221 |
|
221 |
| -- If your app [scales to multiple instances](../../../azure-monitor/autoscale/autoscale-get-started.md), all the instances connect to the same mounted Azure Storage account. To avoid performance bottlenecks and throughput issues, choose the appropriate performance tier for the storage account. |
222 |
| - |
223 |
| -- It isn't recommended to use storage mounts for local databases (such as SQLite) or for any other applications and components that rely on file handles and locks. |
224 |
| -
|
225 |
| -- Ensure the following ports are open when using VNET integration: |
226 |
| - - Azure Files: 80 and 445. |
227 |
| - - Azure Blobs: 80 and 443. |
| 222 | +- The mount directory in the custom container should be empty. Any content stored at this path is deleted when the Azure Storage is mounted (if you specify a directory under `/home`, for example). If you are migrating files for an existing app, make a backup of the app and its content before you begin. |
| 223 | +- If you delete an Azure Storage account, container, or share, remove the corresponding storage mount configuration in the app to avoid possible error scenarios. |
| 224 | +- It isn't recommended to use storage mounts for local databases (such as SQLite) or for any other applications and components that rely on file handles and locks. |
| 225 | +- Ensure the following ports are open when using VNET integration: Azure Files: 80 and 445. Azure Blobs: 80 and 443. |
| 226 | +- If you [initiate a storage failover](../../../storage/common/storage-initiate-account-failover.md) when the storage account is mounted to the app, the mount won't connect until the app is restarted or the storage mount is removed and re-added. |
228 | 227 |
|
229 |
| -- If you [initiate a storage failover](../../../storage/common/storage-initiate-account-failover.md) when the storage account is mounted to the app, the mount won't connect until the app is restarted or the storage mount is removed and readded. |
230 | 228 | ## Next steps
|
231 | 229 |
|
232 | 230 | - [Configure a custom container](../../configure-custom-container.md?pivots=platform-linux).
|
|
0 commit comments