Mount NFS Azure file share on Linux

Azure file shares can be mounted in Linux distributions using either the Server Message Block (SMB) protocol or the Network File System (NFS) protocol. This article is focused on mounting with NFS. For details on mounting SMB Azure file shares, see Use Azure Files with Linux. For details on each of the available protocols, see Azure file share protocols.

Support

Currently, only NFS version 4.1 is supported. NFS 4.1 shares are only supported within the FileStorage storage account type (premium file shares only).

NFS Azure file shares support most features from the 4.1 protocol specification. Some features such as delegations and callback of all kinds, Kerberos authentication, and encryption-in-transit aren't supported.

The nconnect mount option is currently in preview and isn't recommended for production use.

Regional availability

Azure NFS file shares is supported in all the same regions that support premium file storage.

For the most up-to-date list, see the Premium Files Storage entry on the Azure Products available by region page.

Prerequisites

Disable secure transfer

  1. Sign in to the Azure portal and access the storage account containing the NFS share you created.

  2. Select Configuration.

  3. Select Disabled for Secure transfer required.

  4. Select Save.

    Screenshot of storage account configuration screen with secure transfer disabled.

Mount an NFS share using the Azure portal

  1. Once the file share is created, select the share and select Connect from Linux.

  2. Enter the mount path you'd like to use, then copy the script.

  3. Connect to your client and use the provided mounting script.

    Screenshot of file share connect blade.

You have now mounted your NFS share.

Mount an NFS share using /etc/fstab

If you want the NFS file share to automatically mount every time the Linux server or VM boots, create a record in the /etc/fstab file for your Azure file share. Replace YourStorageAccountName and FileShareName with your information.

<YourStorageAccountName>.file.core.windows.net:/<YourStorageAccountName>/<FileShareName> /mount/<YourStorageAccountName>/<FileShareName> nfs vers=4,minorversion=1,sec=sys 0 0

For more information, enter the command man fstab from the Linux command line.

Validate connectivity

If your mount failed, it's possible that your private endpoint wasn't set up correctly or isn't accessible. For details on confirming connectivity, see Verify connectivity.

Next steps