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
Open port 2049 on the client you want to mount your NFS share to.
Important
NFS shares can only be accessed from trusted networks.
Either create a private endpoint (recommended) or restrict access to your public endpoint.
To enable hybrid access to an NFS Azure file share, use one of the following networking solutions:
Disable secure transfer
Sign in to the Azure portal and access the storage account containing the NFS share you created.
Select Configuration.
Select Disabled for Secure transfer required.
Select Save.
Mount an NFS share using the Azure portal
Note
You can use the nconnect
Linux mount option to improve performance for NFS Azure file shares at scale. For more information, see Improve NFS Azure file share performance with nconnect.
Once the file share is created, select the share and select Connect from Linux.
Enter the mount path you'd like to use, then copy the script.
Connect to your client and use the provided mounting script.
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
- Learn more about Azure Files with Planning for an Azure Files deployment.
- If you experience any issues, see Troubleshoot NFS Azure file shares.
Feedback
Submit and view feedback for