How to create NFS share on Azure Blob Storage

Quick steps to enable the NFS share in the Azure Storage account.

Utkarsh Shigihalli
3 min readMar 4, 2023

If you are using Linux file systems, be it as extended shares for your Linux VMs or as persistent storage for your Red Hat OpenShift workloads, they will be required to be compatible with Network File System (NFS) protocol.

NFS being cross-platform, offers high-performance sharing capabilities making it ideal for workloads where latency needs to be minimal.

Creating NFS container

First, ensure you you are selected Premium SKU and account type as File shares

Complete the storage account creation wizard. Once the resource is created, create the share.

You will see the share created under File shares.

Connecting to NFS Share

The NFS share we created can only be accessed from virtual network it is in. So we will go ahead an create a Linux VM and use it to connect to the file share.

For authentincation type I use SSH and use one of my existing SSH keys. However you can also generate a new one if you don’t have one.

For ports, ensure you have allowed both 80 and 22.

Once your VM is ready and you can login, we will need to setup private endpoint for the NFS share and configure it such that our VM is in the same Virtual Network as our storage account.

Click the file share and head over to Configure network security and click Setup a private endpoint

Click on + Private endpoint

and add a private endpoint.

In the Networking tab, ensure you are selecting the same virtual network which you used for your VM.

In the DNS tab, ensure you have selected the correct subscription and resource group.

Finally, since Azure files does not support encryption-in-transit, we need to disable Secure transfer required if you have not done already.

If all is correct, you will be presented with a screen showing instructions on how to mount the share in the Linux VM.

As you can see in the screenshot, the steps involve running following commands on our Ubuntu VM we provisioned above

# update package repositories
sudo apt-get -y update

# install nfs-common package
sudo apt-get install nfs-common

# create a folder on the VM to mount
sudo mkdir -p /mount/stgactaronfsshare001/nfsdata

# mount the file share
sudo mount -t nfs stgactaronfsshare001.file.core.windows.net:/stgactaronfsshare001/nfsdata

That is it! You will now be able to create contents and use it in our workloads.

--

--

Utkarsh Shigihalli

Microsoft MVP | Developer | Passionate about Cloud, .NET and DevOps