Azure Files Documentation
Azure Files offers fully managed cloud file shares that are accessible via the industry-standard Server Message Block (SMB) protocol and Network File System (NFS) protocol. This means you can "lift and shift" legacy applications that rely on file shares to Azure. Azure Files can be mounted concurrently by cloud or on-premises Windows, macOS, and Linux deployments.
Key Concepts
Azure File Share
An Azure file share is the root directory for files and folders in an Azure Storage account. It's like a drive letter in Windows or a mount point in Linux.
Protocols
- SMB (Server Message Block): The primary protocol for file sharing, commonly used by Windows clients. Azure Files supports SMB 2.1 and SMB 3.0.
- NFS (Network File System): Primarily used by Linux and Unix-like systems. Azure Files supports NFS 4.1.
Access Tiers
Azure Files supports different access tiers to optimize costs based on your data access patterns:
- Premium tier: For I/O-intensive workloads requiring low latency.
- Transaction optimized tier: For workloads that access data frequently.
- Hot tier: For workloads that access data frequently.
- Cool tier: For workloads that access data infrequently.
Getting Started
Creating an Azure File Share
You can create an Azure file share using the Azure portal, Azure CLI, Azure PowerShell, or REST APIs. Here's a simplified example using Azure CLI:
az storage account create --name mystorageaccount --resource-group myresourcegroup --sku Standard_LRS --kind StorageV2
az storage share create --name myshare --account-name mystorageaccount --quota 5120 --output table
Mounting an Azure File Share
Mounting a file share depends on your client operating system.
Windows
Use the net use
command with your storage account name and key:
net use Z: \\mystorageaccount.file.core.windows.net\myshare /u:Azure\mystorageaccount
Linux
Use the mount
command:
sudo mount -t cifs //mystorageaccount.file.core.windows.net/myshare /mnt/mymountpoint -o vers=3.0,username=mystorageaccount,password=,dir_mode=0777,file_mode=0777,serverino
For NFS, refer to the specific NFS mounting instructions for Azure Files.
Security and Access Control
Azure Files provides robust security features:
- Storage Account Keys: For basic authentication.
- Azure AD DS or AD DS Authentication: For integrated domain authentication (SMB only).
- Shared Key Authorization: The default method.
- Service Endpoints and Private Endpoints: To restrict network access.
Use Cases
- Lift and shift legacy applications requiring file shares.
- Centralized file storage for applications and development tools.
- Shared configuration files for distributed applications.
- "Home" directories for user profiles.
NFS v4.1 Support
Azure Files now supports NFS v4.1, enabling secure, high-performance access to file shares for Linux and macOS clients. This is ideal for HPC (High-Performance Computing), web serving, and other Linux-centric workloads.
Troubleshooting
Common issues include connectivity problems, authentication failures, and performance bottlenecks. Refer to the official Azure Files Troubleshooting Guide for detailed solutions.