Azure File Storage Quickstart

This guide will walk you through the essential steps to get started with Azure File Storage, a fully managed cloud file share service that is accessible via the industry-standard Server Message Block (SMB) protocol.

Step 1: Create an Azure Storage Account

Before you can create a file share, you need a storage account. If you don't have one, you can create it through the Azure portal, Azure CLI, or Azure PowerShell.

Using Azure Portal:

  1. Sign in to the Azure portal.
  2. Navigate to "Storage accounts" and click "Create".
  3. Fill in the required details: Subscription, Resource group, Storage account name (globally unique), Region, and Performance tier.
  4. Under the "Advanced" tab, ensure "File shares" is enabled.
  5. Review and create the storage account.

Using Azure CLI:

az storage account create \
    --name mystorageaccount <your_unique_storage_account_name> \
    --resource-group myresourcegroup \
    --location eastus \
    --sku Standard_LRS > /dev/null

Step 2: Create a File Share

Once your storage account is created, you can create a file share within it. File shares are organized into directories and files.

Using Azure Portal:

  1. Go to your storage account in the Azure portal.
  2. Under "Data storage", select "File shares".
  3. Click "+ File share".
  4. Enter a name for your file share (e.g., myshare) and specify a quota.
  5. Click "Create".

Using Azure CLI:

az storage share create \
    --name myshare \
    --account-name mystorageaccount \
    --quota 1024 > /dev/null

Step 3: Mount the File Share

To access your file share, you need to mount it to your client machine. The mounting process varies depending on your operating system.

Mounting on Windows:

You can use the net use command. You'll need your storage account name and one of its access keys.

  1. Get your storage account key from the Azure portal (under "Access keys").
  2. Open Command Prompt or PowerShell as administrator.
  3. Run the following command, replacing placeholders:
net use Z: \\mystorageaccount.file.core.windows.net\myshare /user:AZURE\ 

Note: Replace Z: with your desired drive letter.

Mounting on Linux:

You can use the mount command with the CIFS protocol.

  1. Install the CIFS common utilities if you haven't already:
    sudo apt-get update && sudo apt-get install cifs-utils (Debian/Ubuntu) or sudo yum install cifs-utils (RHEL/CentOS).
  2. Create a mount point directory:
    sudo mkdir /mnt/myshare
  3. Mount the share:
sudo mount -t cifs //mystorageaccount.file.core.windows.net/myshare /mnt/myshare -o vers=3.0,username=,password=,dir_mode=0777,file_mode=0777,serverino

Note: For persistent mounts, consider adding an entry to /etc/fstab.

Mounting on macOS:

You can use Finder's "Connect to Server" option or the mount command.

Finder:

  1. Open Finder.
  2. Go to "Go" > "Connect to Server...".
  3. Enter: smb://mystorageaccount.file.core.windows.net/myshare
  4. Click "Connect" and authenticate with your storage account name and key.

Step 4: Upload and Download Files

Once mounted, you can interact with your file share like any other local directory.

Upload: Copy files into the mounted drive/directory.

Download: Copy files from the mounted drive/directory to your local machine.

Next Steps

Congratulations! You've successfully set up and accessed an Azure File Share. Here are some ideas for what to do next:

View Official Documentation