Azure Storage Documentation

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

Creating an Azure File Share using the Azure Portal

The Azure portal provides a user-friendly interface for creating and managing Azure resources.

Steps:

  1. 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.
  2. Access File Shares: In the left-hand menu of your storage account, under the "Data storage" section, select "File shares".
  3. Create New File Share: Click the "+ File share" button at the top of the File shares blade.
  4. 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.
  5. 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

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
Note: The maximum size of a file share is 5 TiB for Standard storage accounts and 100 TiB for Premium storage accounts. The quota can be adjusted at any time.
Tip: For optimal performance, consider using the Transaction optimized or Hot tiers for workloads with high I/O operations.
Important: Ensure you understand the pricing implications of different tiers and redundancy options before creating your file share.

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.