Bring Your Own Storage in Azure Web App
Published Jul 27 2021 04:56 PM 10K Views

This article will show you a general idea on how to Mount Azure Storage as a local share in a container app in App Service

and some key points when use it.


1. What is Bring your own storage(BYOS)?

BYOS means bring your own Azure Storage File share or Blob container into Azure Container Web App as network file share.

It supports Azure Linux Web App and Windows Container Web App, but does not support Azure Function Apps as of now. (Linux Function App cannot be configured from portal but can be configured via Azure CLI)

With BYOS, you do not need to rewrite code to use Storage SDK. Compared to Mount SMB Azure file share on Linux VM, it is much easier for using.


2. How to use it?

We can use it by simply clicking on Azure Portal:


Or use Azure CLI, note that "custom-id" should be unique:

az webapp config storage-account add --resource-group <group-name> --name <app-name> --custom-id <custom-id> --storage-type <AzureFiles/AzureBlob> --share-name <share-name> --account-name <storage-account-name> --access-key "<access-key>" --mount-path <mount-path-directory>


Also, you can integrate it with ARM template:

"resources": [
      "properties": {
          "siteConfig": {
              "azureStorageAccounts": {
                  "[parameters('BYOS_mountName')]": {


3. Some key points:

  • When using AzureFiles, it mounted as CIFS with read/write permission, when using AzureBlob, it mounted as blobfuse with readonly permission.
  • Azure Storage in App Service lets you specify up to five mount points per app.
  • Azure Storage mounted to an app is not accessible through App Service FTP/FTPs endpoints.
  • Storage mounts are not backed up when you back up your app
  • It is not recommended to put the Storage Account in a different region from the Web App because this adds latency. Latency between App Service and Storage can cause crashes due to not being able to mount the Storage share. 
  • The share name for AzureFiles should come from Files shares in Storage Account



  • The share name for AzureBlob should come from Containers in Storage Account


  • If we mount the blob container as AzureFile in Advanced mode, the web app will crash.

After mounting, the web app will restart automatically, then we can check the mount info via ‘cat /etc/mtab’.



  • For AzureFiles, it will be shown as cifs rw, which means read/write. For AzureBlob, it will be shown as fuse ro, which means readonly.


4. What is CIFS? And related issue.

Common Internet File System (CIFS) is a network filesystem protocol used for providing shared access to files and printers between machines on the network. A CIFS client application can read, write, edit and even remove files on the remote server. CIFS client can communicate with any server that is set up to receive a CIFS client request.


When use CIFS, local databases (eg SQLLite) or other components that rely on file handles/locks may get problem.



One workaround for the sqlite issue is changing the journal mode to wal by using below command:

sqlite3 <database-file> 'PRAGMA journal_mode=wal;'

There are advantages and disadvantages to using WAL instead of a rollback journal. Please read this reference carefully before using it: 


Thanks for reading this post. I hope you liked it. Please feel free to write your comments and views about the same over here.


Version history
Last update:
‎Nov 01 2021 05:30 AM
Updated by: