Azure File Shares

Microsoft File Share is a fully managed service hosted on the Microsoft Azure cloud. It can be shared and accessed by using NFS and SMB protocols. How does it work, and how can you deploy this service?

In recent months, I have noticed that many companies are moving their File Share services to the Azure cloud. There are many reasons why companies might look into moving their file shares from on-premises to the cloud; some of the reasons are:

  • Cloud application adoption: Companies increasing use of cloud adoptions and SaaS offerings mean they find it easier and cheaper to host the application files and data on the cloud.
  • Development: Keeping the data securely close to the application where it helps with sharing:
    • Application configuration,
    • Application diagnostics and data mining,
    • and testing/debugging.
  • Containers: The increasing utilization of containers and Kubernetes technology means File Shares services can be used as persistent volumes for stateful containers.

Azure File Share Deployment

Creating an Azure SMB File Share is a very simple task. Create an Azure storage account, then choose the File Share option as highlighted on the following screenshot:

After you have created the storage account, you can create an SMB share. Select “File Shares” from the side menu, then press “+ File Share” from the top menu:

Those previous steps allow you to create an SMB share; but as may have noticed, there is no option to create an NFS share. In many cases, an NFS share is the more preferred option for many organizations. So, how can you create an Azure NFS share?

The first step is to enable the NFS protocol on your subscription. To do that, we must follow the following steps:

  • Open a Powershell Command-Line and connect to your Azure account using the following command: 
    • Connect-AzAccount 

  • If you are like me and have several Accounts, then you must select the account on which you are going to enable the NFS feature. To list all your Azure accounts, run the following command: 
    • Get-AzSubscription 

    • From the account list, note the account name and use the Select command to select the required account:
      • Select-AzSubscription “Account Name”

Register the NFS 4.1 feature with Azure Files to enable the preview

After you have connected to your Azure account, now you need to run the below PowerShell commands to enable the NFS 4.1 feature:

  • Register-AzProviderFeature `

    -ProviderNamespace Microsoft.Storage `

    -FeatureName AllowNfsFileShares

  • Register-AzResourceProvider -ProviderNamespace Microsoft.Storage

Following those previous steps enables the NFS feature on your Azure account. Now you can create an NFS share ready to be used with your applications; or just for file sharing:

Connect to the NFS Share

A Network Private or Service End-Point must be configured to provide a connection to the NFS share.

After setting up the Service End-Point, you can browse to the “File Shares” from the side menu; then select your File Share folder. Under the Share name and details, you can see the commands necessary for mounting the newly created NFS share:

Conclusion

The Azure NFS Share feature is still in the preview stage; that is why you must use the PowerShell or Azure Az to register for this feature. In the future, I expect to see that many of the steps described above will be deprecated and become part of the storage account creation process.

Leave a Reply