Azure File Shares can be mounted using either the SMB or NFS protocol, and choosing the right one depends on your operating system and workload.

Let’s see an Azure File Share in action, mounted via SMB on a Windows client.

# Install Azure CLI if you haven't already
# az --version

# Log in to your Azure account
az login

# Set your subscription
az account set --subscription "Your Subscription Name"

# Get storage account name and access key
STORAGE_ACCOUNT_NAME="yourstorageaccountname"
STORAGE_ACCOUNT_KEY=$(az storage account keys list --account-name $STORAGE_ACCOUNT_NAME --query "[0].value" -o tsv)

# Create a directory to mount the share
New-Item -ItemType Directory -Path "C:\Mount\AzureFileShareSMB"

# Mount the file share using the storage account name and key
# Replace 'yourfilesharename' with the actual name of your file share
net use C:\Mount\AzureFileShareSMB \\$STORAGE_ACCOUNT_NAME.file.core.windows.net\yourfilesharename $STORAGE_ACCOUNT_KEY /user:Azure\$STORAGE_ACCOUNT_NAME

# Verify the mount
Get-PSDrive C, Z # Assuming Z is the next available drive letter, or use the specific path

Now, let’s explore the underlying mechanics.

Azure File Shares are managed by Azure Storage, a massively scalable cloud storage service. When you create a file share, you’re essentially provisioning a file system accessible over the network. The key differentiator here is the protocol: SMB (Server Message Block) and NFS (Network File System).

SMB is the de facto standard for file sharing in Windows environments. It’s a stateful protocol, meaning the client and server maintain connection state. This makes it robust for interactive use and applications that expect traditional file system behavior. Azure File Shares support SMB 3.0 and later, which offers significant performance improvements and features like encryption and multi-channel.

NFS is the traditional standard for Unix-like systems (Linux, macOS). It’s designed for distributed file systems and is often preferred for high-performance computing, big data analytics, and Linux-based applications. Azure File Shares support NFSv4.1, which is a modern, secure, and performant version of NFS.

The primary problem these protocols solve is providing a persistent, network-accessible file store for your applications and users, without needing to manage underlying infrastructure like servers or disks. You can mount these shares on virtual machines, containers, or even on-premises machines (with appropriate network configuration).

The internal workings involve Azure Storage acting as the SMB or NFS server. When a client requests a file operation (read, write, create, delete), the request is sent over the network to Azure Storage. Azure Storage then translates these protocol requests into operations on its massive, distributed object store. This abstraction is what allows for the scalability and durability you expect from Azure.

The levers you control are primarily at the Azure Storage and client configuration levels.

Azure Storage Level:

  • Storage Account: The container for your file shares. You choose the performance tier (Standard or Premium) which impacts IOPS and throughput.
  • File Share: The actual file share resource. You define its size (up to 100 TiB for standard, 5 TiB per snapshot for premium).
  • Access Tiers (Standard only): Hot, Cool, and Archive tiers affect cost and latency.
  • Networking: You can restrict access to specific virtual networks, IP addresses, or use Private Endpoints for enhanced security.
  • NFSv4.1 Kerberos (for NFS): For secure NFS access, you can integrate with Azure Active Directory Domain Services (Azure AD DS) or on-premises AD DS for Kerberos authentication.

Client Level:

  • Protocol Choice: Decide whether to use SMB or NFS based on your client OS and application needs.
  • Mount Command/Options: The specific command used to mount the share (e.g., net use on Windows, mount on Linux) and its options (e.g., vers for SMB version, sec for security mode in NFS).
  • Authentication: Using account keys (simple, less secure), Shared Access Signatures (SAS) for granular, time-limited access, or Active Directory/Azure AD DS for Kerberos.
  • Performance Tuning: Client-side settings like SMB multi-channel or NFS mount options can influence performance.

A common point of confusion is when using NFS and encountering "permission denied" errors, even with correct Azure AD DS or on-premises AD DS Kerberos setup. This often stems from the sec= option in the NFS mount command. If you’ve configured Kerberos, you must specify sec=krb5, sec=krb5i, or sec=krb5p in your mount command. Simply having Kerberos configured on the server-side isn’t enough; the client needs to be told to use it for authentication.

The next logical step after successfully mounting an Azure File Share is to explore how to achieve high availability and disaster recovery for the data stored within it.

Want structured learning?

Take the full Azure course →