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.

  1. Sign in to the Azure portal.
  2. In the search bar at the top, type "Storage accounts" and select it from the list.
  3. Click + Create to open the Create storage account page.
  4. Select your Azure subscription and resource group. If you don't have one, create a new one.
  5. Enter a unique name for your storage account (e.g., mystorageaccount12345).
  6. Select a region for your storage account.
  7. Choose a performance tier (Standard or Premium) and redundancy option.
  8. Click Review + create, then Create.
  9. Once the storage account is deployed, navigate to the storage account resource.
  10. In the left-hand menu, under Data storage, select File shares.
  11. Click + File share.
  12. Enter a name for your file share (e.g., myshare). Share names must be lowercase letters and numbers.
  13. Set the Tier for your file share (Transaction optimized, Hot, or Cool).
  14. Optionally, set a Quota for the share.
  15. 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.

Tip: When naming your storage accounts, they must be globally unique and consist of 3 to 24 lowercase letters and numbers only. File share names must also be lowercase letters and numbers.

Next Steps

Now that you have created an Azure File Share, you can: