Introduction to Azure File Storage
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 the cloud or on-premises deployments of Windows, Linux, and macOS.
On this page
What is Azure Files?
Azure Files provides a fully managed file share that you can access from anywhere. It's built on top of Azure Storage and integrates seamlessly with other Azure services. Unlike Blob Storage, which is object storage, Azure Files provides a hierarchical namespace and supports file locking, making it suitable for traditional file share workloads.
With Azure Files, you get:
- Managed File Shares: No need to manage underlying hardware or operating systems.
- SMB and NFS Support: Access your shares using standard protocols from Windows, Linux, and macOS.
- Cloud and On-Premises Access: Mount shares from virtual machines, containers, or your on-premises data center.
- Enterprise-Grade Capabilities: Supports features like access control lists (ACLs), encryption, and high availability.
Key Features
- Server Message Block (SMB) 3.0 Protocol: Enables standard Windows file sharing, making it easy to migrate existing applications.
- Network File System (NFS) 4.1 Protocol: Supports Linux and macOS clients for network file access.
- Performance Tiers: Choose between Standard and Premium tiers for varying performance and cost needs. Premium tier offers SSD-backed storage for high-performance workloads.
- Redundancy Options: Locally redundant storage (LRS), geo-redundant storage (GRS), and zone-redundant storage (ZRS) to protect your data.
- Azure File Sync: A feature that allows you to centralize your organization's file shares in Azure Files while keeping the flexibility, performance, and compatibility of an on-premises file server.
- Identity-Based Authentication: Integrate with Azure Active Directory (Azure AD) Domain Services for robust access control.
Common Use Cases
Lift and Shift Applications
Migrate traditional file-share-dependent applications to the cloud without significant re-architecture. Examples include shared configuration files, application executables, and shared user data.
Development and Testing
Provide shared storage for development tools, build artifacts, and test environments across multiple virtual machines.
- Shared Configuration: Store application configuration files in a central location accessible by multiple instances.
- Content Sharing: Share documents, images, and other media content across applications and users.
- Software Deployment: Deploy applications and updates to multiple servers from a central file share.
- Disaster Recovery: Use Azure Files as a target for backups and disaster recovery solutions.
Getting Started
To start using Azure File Storage, you need an Azure subscription. You can create a storage account, and then create a file share within that account.
1. Create a Storage Account
A storage account is a container for Azure Storage services. You can create one using the Azure portal, Azure CLI, or PowerShell.
# Example using Azure CLI
az storage account create --name mystorageaccount --resource-group myresourcegroup --location eastus --sku Standard_LRS --kind StorageV2
2. Create a File Share
Once you have a storage account, you can create a file share. You can specify a quota for the share.
# Example using Azure CLI
az storage share create --name myfileshare --account-name mystorageaccount --quota 1024 --output none
3. Mount the File Share
You can mount the file share to your client machines using SMB or NFS. The Azure portal provides connection strings and commands for mounting.
Example (Windows PowerShell):
$connectionString = "DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=YOUR_ACCOUNT_KEY;EndpointSuffix=core.windows.net"
$shareName = "myfileshare"
$mountedPath = "Z:\"
# Install the SMB module if not already present
if (-not (Get-Module -ListAvailable -Name SmbShare)) {
Install-Module -Name SmbShare -Force
}
# Mount the share
New-SmbMapping -LocalPath $mountedPath -RemotePath "\\mystorageaccount.file.core.windows.net\$shareName" -Credential (Get-Credential)
Example (Linux):
sudo apt-get update
sudo apt-get install cifs-utils
# Create a mount point
sudo mkdir /mnt/mymount
# Mount the share (using account key for simplicity, consider Azure AD for production)
sudo mount -t cifs //mystorageaccount.file.core.windows.net/myfileshare /mnt/mymount -o vers=3.0,username=mystorageaccount,password='YOUR_ACCOUNT_KEY',dir_mode=0777,file_mode=0777,serverino
For production environments, it is highly recommended to use Azure AD integration for authentication instead of account keys.
Azure File Storage provides a flexible and scalable solution for all your file storage needs in the cloud. Explore the documentation further to learn about performance tuning, security configurations, and integration with Azure File Sync.