Azure Storage Files
Comprehensive documentation for managing and interacting with file shares in Azure.
Introduction to Azure Files
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 features include:
- SMB and NFS Support: Access your files using common protocols.
- Managed Service: No need to manage underlying hardware or software.
- Hybrid Cloud Access: Mount shares from anywhere, on-premises or in the cloud.
- Data Durability and Availability: Built on Azure Storage's robust infrastructure.
Key Concepts
Storage Accounts
Azure Files is part of an Azure Storage account. A storage account provides a unique namespace in Azure for your data objects. When you create a storage account, you choose a replication strategy (e.g., LRS, GRS) that determines the durability and availability of your data.
Refer to the Azure Storage Accounts documentation for more details.
File Shares
A file share is the primary object in Azure Files. It's a scalable, cloud-based file share that you can access using SMB or NFS. You can organize files and directories within a file share.
Mounting File Shares
Azure Files can be mounted to client machines using SMB or NFS. The method for mounting depends on the client operating system.
- Windows: Use the
net use
command. - Linux: Use the
mount
command with SMB or NFS options. - macOS: Use the
mount_smbfs
command.
Authentication and Authorization
Access to Azure File shares can be secured using Azure Active Directory (Azure AD) Domain Services or on-premises Active Directory Domain Services. You can also use storage account keys for simpler scenarios.
Common Scenarios
- Application Settings: Store configuration files centrally.
- Shared Data: Enable data sharing between applications and services.
- Development and Testing: Provide shared storage for development environments.
- Backup and Archiving: Use as a target for backups and archival storage.
- "Lift and Shift" Applications: Migrate applications dependent on file shares to the cloud.
Getting Started
To get started with Azure Files, you'll need an Azure subscription. You can create a storage account and then create a file share within that account.
Creating a Storage Account and File Share
You can use the Azure portal, Azure CLI, Azure PowerShell, or SDKs to create and manage Azure File shares.
Using Azure CLI:
# Create a resource group
az group create --name myResourceGroup --location eastus
# Create a storage account
az storage account create --name mystorageaccount --resource-group myResourceGroup --sku Standard_LRS --kind StorageV2
# Create a file share
az storage share create --name myshare --account-name mystorageaccount --account-key
Using Azure PowerShell:
# Create a resource group
New-AzResourceGroup -Name "myResourceGroup" -Location "East US"
# Create a storage account
New-AzStorageAccount -ResourceGroupName "myResourceGroup" -Name "mystorageaccount" -SkuName "Standard_LRS" -Kind "StorageV2"
# Create a file share
New-AzStorageShare -Name "myshare" -Context (Get-StorageAccount -ResourceGroupName "myResourceGroup" -Name "mystorageaccount").Context
SDKs and Tools
Azure Files can be managed and interacted with using various tools and SDKs: