-
Notifications
You must be signed in to change notification settings - Fork 199
Bring your own storage (Linux consumption)
Support for Bring Your Own Storage (BYOS) is now available in all regions.
BYOS enables mounting azure files share as a r/w share available to all instances of a function app. Currently only Azure files is supported, support for mounting blobs (readonly) will be added later.
The easiest way is to use the following Az CLI command
az webapp config storage-account add --name < Function-App-Name > --resource-group < Resource-Group > --subscription < Subscription-Id > --custom-id < Unique-Custom-Id > --storage-type AzureFiles --account-name < Storage-Account-Name > --share-name < File-Share-Name > --access-key < Storage-Account-AccessKey > --mount-path </path/to/mount>
Any unique string
Only AzureFiles is supported currently
Pre existing share
Path at which the share will be accessible inside the container. has to be of the format /dir-name. Cannot start with /home.
Additional commands to modify / delete the file share configuration - https://docs.microsoft.com/en-us/cli/azure/webapp/config/storage-account?view=azure-cli-latest#az-webapp-config-storage-account-update
The mounted share will be available at the path specified. Ex: /path/to/mount The target directory can be accessed by file system apis
Ex:
var directories = Directory.EnumerateDirectories("/path/to/mount");
var files = Directory.EnumerateFiles("/a/different/mounted/path");
A max of 5 file shares can be mounted. Mounting a file share can add upto 200 - 300 ms to cold start (more if the storage account is in a different region).