How to Create Azure File Shares
This guide walks you through the process of creating an Azure File share, a fully managed cloud file share that is accessible via the industry-standard Server Message Block (SMB) protocol. Azure Files also supports the Network File System (NFS) protocol for Linux clients.
Prerequisites
- An Azure subscription. If you don't have one, create a free account before you begin.
- A storage account. If you don't have one, follow the "Create a storage account" guide.
Creating an Azure File Share using the Azure Portal
The Azure portal provides a user-friendly interface for creating and managing Azure resources.
Steps:
- Navigate to your Storage Account: In the Azure portal, go to your storage account resource. You can search for it in the search bar at the top of the portal.
- Access File Shares: In the left-hand menu of your storage account, under the "Data storage" section, select "File shares".
- Create New File Share: Click the "+ File share" button at the top of the File shares blade.
-
Configure the File Share:
A new pane will appear asking for details:
- Name: Enter a unique name for your file share. Share names must be 3-63 characters long and can contain lowercase letters, numbers, and hyphens. They cannot start or end with a hyphen.
- Tier: Select the performance tier for your file share. Options typically include:
- Transaction optimized: Recommended for most workloads.
- Hot: For data that is accessed frequently.
- Cool: For data that is accessed infrequently.
- Redundancy: Choose the redundancy option for your data (e.g., LRS, GRS, RA-GRS). The default is usually sufficient for most scenarios.
- Create: Click "Create" to provision your new file share.
Creating an Azure File Share using Azure CLI
You can also use the Azure Command-Line Interface (CLI) for scripting and automation.
First, ensure you are logged into your Azure account:
az login
Next, create the file share using the az storage share create command:
az storage share create --name MyAzureFileShare --account-name MyStorageAccount --quota 100 --output table
- Replace
MyAzureFileSharewith your desired share name. - Replace
MyStorageAccountwith the name of your storage account. - The
--quota 100sets the quota to 100 GiB. Adjust this value as needed.
Creating an Azure File Share using Azure PowerShell
Azure PowerShell offers another powerful way to manage your Azure resources programmatically.
Connect to your Azure account:
Connect-AzAccount
Then, create the file share using the New-AzStorageShare cmdlet:
New-AzStorageShare -ShareName "MyAzureFileShare" -Context $ctx -QuotaGiB 100
You'll need to obtain the storage account context first:
$storageAccountName = "MyStorageAccount"
$storageAccount = Get-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name $storageAccountName
$ctx = $storageAccount.Context
- Replace
MyAzureFileSharewith your desired share name. - Replace
MyStorageAccountwith the name of your storage account. - Replace
MyResourceGroupwith the name of the resource group containing your storage account. - The
-QuotaGiB 100sets the quota to 100 GiB.
Next Steps
Once your file share is created, you'll typically want to mount it to your virtual machines or on-premises servers. Refer to the Mount Azure File Shares guide for detailed instructions.