
When you are done using the Azure file share, use sudo umount $mntPath to unmount the share. You can also mount the same Azure file share to multiple mount points if desired. For more information on how to set permissions, see UNIX numeric notation on Wikipedia. You can use uid/ gid or dir_mode and file_mode in the mount options for the mount command to set permissions. Sudo mount -t cifs $smbPath $mntPath -o vers=2.1,username=$storageAccountName,password=$storageAccountKey,serverino,nosharesock,actimeo=30 StorageAccountKey=$(az storage account keys list \ SmbPath=$(echo $httpEndpoint | cut -c7-$)$fileShareName query "primaryEndpoints.file" -output tsv | tr -d '"') # This command assumes you have logged in with az login

Replace and then run the following script: resourceGroupName="" If you prefer to use the Azure PowerShell module in PowerShell 6+, you may, however the instructions in this article are for the Azure CLI.Įnsure port 445 is open: SMB communicates over TCP port 445 - check to see if your firewall is not blocking TCP ports 445 from client machine.

For more information on how to install the Azure CLI, see Install the Azure CLI and select your operating system. The most recent version of the Azure Command Line Interface (CLI). On other distributions, use the appropriate package manager or compile from source. On SUSE Linux Enterprise Server, use the zypper package manager: sudo zypper install cifs-utils On older versions of Red Hat Enterprise Linux use the yum package manager: sudo yum install cifs-utils On Red Hat Enterprise Linux 8+ use the dnf package manager: sudo dnf install cifs-utils On Ubuntu and Debian, use the apt package manager: sudo apt update

The cifs-utils package can be installed using the package manager on the Linux distribution of your choice. Premium file shares (FileStorage), LRS/ZRSĮnsure the cifs-utils package is installed. If you're using a version of the Linux kernel after 3.7, it should support SMB 2.1. SMB 2.1 support was added to Linux kernel version 3.7.

If your Linux distribution isn't listed in the above table, you can check the Linux kernel version with the uname command: uname -r Unless your application specifically requires SMB 2.1, use SMB 3.1.1. Azure Files also supports SMB 2.1, which doesn't support encryption in transit, but you can't mount Azure file shares with SMB 2.1 from another Azure region or on-premises for security reasons. By default, Azure Files requires encryption in transit, which is supported by SMB 3.0+. The recommended way to mount an Azure file share on Linux is using SMB 3.1.1. Azure file shares can be mounted in Linux distributions using the SMB kernel client. Azure Files is Microsoft's easy to use cloud file system.
