Create an Azure File Share
This guide walks you through the process of creating an Azure File Share using the Azure portal, Azure CLI, and Azure PowerShell.
Azure Files offers fully managed cloud file shares that are accessible via the industry-standard Server Message Block (SMB) protocol. You can mount Azure File shares concurrently by using the cloud or on-premises Windows, macOS, and Linux operating systems. You can also cache Azure File shares on Windows Server or Linux for local access and speed.
Prerequisites
Before you begin, ensure you have an Azure subscription. If you don't have one, create a free account before you start.
Methods to Create a File Share
1. Using the Azure Portal
The Azure portal provides a user-friendly graphical interface for managing your Azure resources.
- Sign in to the Azure portal.
- In the search bar at the top, type "Storage accounts" and select it from the list.
- Click + Create to open the Create storage account page.
- Select your Azure subscription and resource group. If you don't have one, create a new one.
- Enter a unique name for your storage account (e.g.,
mystorageaccount12345). - Select a region for your storage account.
- Choose a performance tier (Standard or Premium) and redundancy option.
- Click Review + create, then Create.
- Once the storage account is deployed, navigate to the storage account resource.
- In the left-hand menu, under Data storage, select File shares.
- Click + File share.
- Enter a name for your file share (e.g.,
myshare). Share names must be lowercase letters and numbers. - Set the Tier for your file share (Transaction optimized, Hot, or Cool).
- Optionally, set a Quota for the share.
- Click Create.
2. Using the Azure CLI
The Azure Command-Line Interface (CLI) allows you to manage Azure resources from your terminal.
First, create a storage account if you don't have one:
az storage account create \
--name mystorageaccountcli \
--resource-group MyResourceGroup \
--location eastus \
--sku Standard_LRS \
--kind StorageV2
Then, create the file share:
az storage share create \
--name mysharecli \
--account-name mystorageaccountcli \
--quota 1024 \
--output table
Replace mystorageaccountcli with your storage account name and mysharecli with your desired share name. The --quota is in GiB.
3. Using Azure PowerShell
Azure PowerShell provides cmdlets for managing Azure resources.
First, create a storage account if you don't have one:
New-AzStorageAccount -ResourceGroupName "MyResourceGroup" `
-Name "mystorageaccountps" `
-Location "East US" `
-SkuName "Standard_LRS" `
-Kind StorageV2
Then, create the file share:
New-AzStorageShare -Name "myshareps" `
-Context (Get-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccountps").Context `
-QuotaGiB 512
Replace MyResourceGroup, mystorageaccountps, and myshareps with your actual resource group, storage account, and share names.
Next Steps
Now that you have created an Azure File Share, you can:
- Mount the file share and upload/download files.
- Configure access policies and authentication.
- Explore advanced features like snapshots and file sync.