Azure File Storage
Azure File Storage provides fully managed file shares in the cloud that are accessible via the industry-standard Server Message Block (SMB) protocol. This means you can "lift and shift" legacy applications that rely on file shares to Azure without significant code changes.
Key Features
- SMB 3.0 Protocol Support: Mount shares on Windows, macOS, and Linux.
- Shared Access: Multiple VMs and services can mount the same file share concurrently.
- Managed Service: No need to manage underlying infrastructure.
- Scalability: Scales to petabytes of data.
- Security: Supports Azure AD DS authentication, private endpoints, and encryption in transit and at rest.
- Hybrid Cloud Integration: Use Azure File Sync to cache frequently accessed files on-premises for faster local access.
Use Cases
- Lift-and-shift applications requiring file shares.
- Shared configuration files and diagnostic tools.
- Development and testing environments.
- Disaster recovery solutions.
- Content distribution.
Getting Started
1. Creating an Azure File Share
You can create an Azure File Share using the Azure portal, Azure CLI, PowerShell, or REST API. Here's an example using Azure CLI:
az storage share create \
--name mystorageaccount \
--account-name myshare \
--resource-group myresourcegroup \
--quota 1024 \
--output table
2. Mounting an Azure File Share
Mounting the share allows your client machines to access it like a local drive.
On Windows:
Use the net use command. You'll need your storage account name and access key (or use Azure AD credentials for supported scenarios).
net use Z: \\mystorageaccount.file.core.windows.net\myshare /u:mystorageaccount [YourStorageAccountAccessKey]
On Linux:
Install the cifs-utils package and use the mount command.
sudo apt-get update && sudo apt-get install cifs-utils
sudo mount -t cifs //mystorageaccount.file.core.windows.net/myshare /mnt/myshare -o vers=3.0,username=mystorageaccount,password=[YourStorageAccountAccessKey],dir_mode=0777,file_mode=0777,serverino
On macOS:
Use the mount command with the smb type.
mkdir ~/myfileshare
mount -t smbfs //mystorageaccount.file.core.windows.net/myshare ~/myfileshare -o usernam=mystorageaccount,password=[YourStorageAccountAccessKey]
Performance Tiers
Azure Files offers two performance tiers:
- Standard: Uses HDDs for cost-effectiveness.
- Premium: Uses SSDs for high performance and low latency, suitable for demanding workloads.
Pricing
Pricing is based on the performance tier, capacity used, and transactions. You can find detailed pricing information on the Azure Pricing page.