Use mountOptions settings in Azure Files

This article discusses the useful and recommended mounting options when you configure the storage class object on Azure Files. These mounting options help you to provision storage on your Kubernetes cluster.

The following mountOptions field settings are recommended for the Kubernetes version and the file and directory mode (permissions):

Setting Recommended value
Kubernetes version 1.12.2 or later
file_mode and dir_mode value 0777

The following configuration file is an example of how to set the file and directory permissions:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: azurefile
provisioner: kubernetes.io/azure-file
mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=1000
  - gid=1000
  - mfsymlinks
  - nobrl
  - cache=none
parameters:
  skuName: Standard_LRS

Other useful settings

You might also find the following mountOptions settings useful:

Setting Description
mfsymlinks This setting forces the Azure Files mount (Common Internet File System, or cifs) to support symbolic links.
nobrl This setting prevents sending byte range lock requests to the server. It's necessary for certain applications that break with cifs-style mandatory byte range locks. Most cifs servers don't yet support requesting advisory byte range locks. If an application doesn't use this setting and breaks with cifs-style mandatory byte range locks, error messages such as Error: SQLITE_BUSY: database is locked might occur.

Contact us for help

If you have questions or need help, create a support request, or ask Azure community support. You can also submit product feedback to Azure feedback community.