Quickstart: Create and use an Azure file share
Azure Files is Microsoft's easy-to-use cloud file system. Azure file shares can be mounted in Windows, Linux, and macOS. This guide shows you how to create an SMB Azure file share using either the Azure portal, Azure CLI, or Azure PowerShell module.
|File share type||SMB||NFS|
|Standard file shares (GPv2), LRS/ZRS|
|Standard file shares (GPv2), GRS/GZRS|
|Premium file shares (FileStorage), LRS/ZRS|
If you don't have an Azure subscription, create a free account before you begin.
Create a storage account
A storage account is a shared pool of storage in which you can deploy an Azure file share or other storage resources, such as blobs or queues. A storage account can contain an unlimited number of shares. A share can store an unlimited number of files, up to the capacity limits of the storage account.
To create a storage account using the Azure portal:
Under Azure services, select + to create a resource.
Select Storage account to create a storage account.
Under Project details, select the Azure subscription in which to create the storage account. If you have only one subscription, it should be the default.
Select Create new to create a new resource group. For the name, enter myResourceGroup.
Under Instance details, provide a name for the storage account such as mystorageacct followed by a few random numbers to make it a globally unique name. A storage account name must be all lowercase and numbers, and must be between 3 and 24 characters. Make a note of your storage account name. You will use it later.
In Region, select East US.
In Performance, keep the default value of Standard.
In Redundancy, select Locally redundant storage (LRS).
Select Review + Create to review your settings and create the storage account.
When you see the Validation passed notification, select Create. You should see a notification that deployment is in progress.
Create an Azure file share
To create an Azure file share:
Select the storage account from your dashboard.
On the storage account page, in the Services section, select Files.
On the menu at the top of the File service page, click + File share. The New file share page drops down.
In Name type myshare. Leave Transaction optimized selected for Tier.
Select Create to create the Azure file share.
Share names must be all lower case letters, numbers, and single hyphens but cannot start with a hyphen. For complete details about naming file shares and files, see Naming and Referencing Shares, Directories, Files, and Metadata.
Create a directory
To create a new directory named myDirectory at the root of your Azure file share:
- On the File share settings page, select the myshare file share. The page for your file share opens, indicating no files found.
- On the menu at the top of the page, select + Add directory. The New directory page drops down.
- Type myDirectory and then click OK.
Upload a file
To demonstrate uploading a file, you first need to create or select a file to be uploaded. You may do this by whatever means you see fit. Once you've decided on the file you would like to upload:
Select the myDirectory directory. The myDirectory panel opens.
In the menu at the top, select Upload. The Upload files panel opens.
Select the folder icon to open a window to browse your local files.
Select a file and then select Open.
In the Upload files page, verify the file name and then select Upload.
When finished, the file should appear in the list on the myDirectory page.
Download a file
You can download a copy of the file you uploaded by right-clicking on the file and selecting Download. The exact experience will depend on the operating system and browser you're using.
Clean up resources
When you're done, delete the resource group. Deleting the resource group deletes the storage account, the Azure file share, and any other resources that you deployed inside the resource group.
- Select Home and then Resource groups.
- Select the resource group you want to delete.
- Select Delete resource group. A window opens and displays a warning about the resources that will be deleted with the resource group.
- Enter the name of the resource group, and then select Delete.
Submit and view feedback for