Azure File Storage
Azure Files provides 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 without requiring extensive code changes.
Key Features
- Managed Service: No need to manage underlying infrastructure like disks or network appliances.
- SMB and NFS Support: Access shares from Windows, macOS, and Linux clients.
- Cloud Native: Integrates seamlessly with other Azure services.
- Scalability: Scales up to 100 TiB of data per share.
- Security: Supports Azure Active Directory Domain Services (Azure AD DS) and on-premises Active Directory Domain Services (AD DS) for authentication, along with encryption at rest and in transit.
Use Cases
- Lift and Shift: Migrating on-premises applications that use file shares without code modification.
- Shared Configuration Files: Centralizing application settings and configuration across multiple VMs or containers.
- Development and Debugging: Storing development tools, logs, and shared code repositories.
- Data Archiving and Backup: Storing backup data and archival information accessible by multiple systems.
- Content Distribution: Serving static content for web applications or media streaming.
Getting Started
To get started with Azure File Storage, you need an Azure subscription. You can then create a storage account and within it, create file shares.
Creating a Storage Account
You can create a storage account using the Azure portal, Azure CLI, PowerShell, or ARM templates.
Using Azure CLI:
az storage account create \
--name mystorageaccount \
--resource-group myresourcegroup \
--location eastus \
--sku Standard_LRS \
--kind StorageV2
Creating a File Share
Once you have a storage account, you can create a file share:
az storage share create \
--name myfileshare \
--account-name mystorageaccount \
--quota 1024 \
--output table
This command creates a file share named myfileshare with a quota of 1024 GiB in the mystorageaccount storage account.
Mounting Azure File Shares
Azure File shares can be mounted to various operating systems:
Mounting on Windows
Use the net use command with your storage account name and access key:
net use Z: \\mystorageaccount.file.core.windows.net\myfileshare /user:Azure\mystorageaccount YOUR_STORAGE_ACCOUNT_KEY
Mounting on Linux
You can use the mount command:
sudo mount -t cifs //mystorageaccount.file.core.windows.net/myfileshare /mnt/myazurefile \
-o vers=3.0,username=mystorageaccount,password=YOUR_STORAGE_ACCOUNT_KEY,dir_mode=0777,file_mode=0777,serverino
Mounting on macOS
Use Finder's "Connect to Server" option or the mount command.
Pricing and Tiers
Azure File Storage offers different tiers to optimize costs:
- Standard: HDD-based, suitable for general-purpose file sharing.
- Premium: SSD-based, for high-performance workloads.
Refer to the Azure Files pricing page for detailed information.