Azure Storage Files: Getting Started

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

What is Azure Files?

Azure Files provides fully managed cloud file shares that are accessible from multiple clients, including on-premises Windows, macOS, and Linux operating systems, as well as cloud-based or dedicated Windows, macOS, and Linux deployments.

Key features include:

Prerequisites

Before you begin, ensure you have the following:

Step 1: Create an Azure File Share

A file share is the fundamental building block of Azure Files. You can create a file share using the Azure portal, Azure CLI, PowerShell, or SDKs.

Using the Azure Portal:

  1. Navigate to your Azure Storage account in the Azure portal.
  2. In the left-hand menu, under Data storage, select File shares.
  3. Click + File share.
  4. Enter a Name for your file share (e.g., myshare). Names must be lowercase letters and numbers.
  5. Choose a Tier: Transaction optimized, Hot, or Cool. For most general-purpose scenarios, Transaction optimized is a good starting point.
  6. Set the Quota (maximum size of the share) if desired.
  7. Click Create.
Azure Portal showing the File Share creation screen

Step 2: Mount the File Share

Once your file share is created, you can mount it to your client machines. The process varies slightly depending on your operating system.

Mounting on Windows:

  1. In the Azure portal, navigate back to your file share.
  2. Click the Connect button.
  3. Select the drive letter you want to use.
  4. Copy the generated command. It will look something like:
    net use Z: \\storageaccountname.file.core.windows.net\myshare /user:Azure\storageaccountname STORAGEKEY
  5. Open a Command Prompt or PowerShell window as an administrator and paste the command, replacing placeholders with your actual storage account name, share name, and storage account key. You can find your storage account key on the Access keys page of your storage account.

Mounting on Linux:

You'll need to install the necessary CIFS utilities:

sudo apt-get update && sudo apt-get install cifs-utils

Create a mount point and then mount the share:

sudo mkdir /mnt/mymountpoint
sudo mount -t cifs //storageaccountname.file.core.windows.net/myshare /mnt/mymountpoint -o vers=3.0,username=storageaccountname,password=STORAGEKEY,dir_mode=0777,file_mode=0777,serverino

Replace placeholders with your actual credentials.

Mounting on macOS:

Open Finder, go to Go > Connect to Server. Enter the server address in the format:

smb://storageaccountname.file.core.windows.net/myshare

Click Connect and you will be prompted for your username and password. Use storageaccountname as the username and your storage account key as the password.

Security Note: For production environments, it is highly recommended to use Azure Key Vault to manage your storage account keys instead of embedding them directly in scripts or command lines.

Step 3: Access and Manage Your Files

Once the file share is mounted, you can interact with it like any other local drive or directory. You can create, delete, copy, and move files and folders within the mounted share.

Common Operations:

Next Steps

Congratulations! You have successfully created and mounted your first Azure File share.

Here are some resources to help you further explore Azure Files:

Explore More How-To Guides