Quickstart: Create and manage Azure file shares with the Azure portal

Azure Files is Microsoft's easy-to-use cloud file system. Azure file shares can be mounted in Windows, Linux, and macOS. This guide walks you through the basics of working with Azure file shares using the Azure portal.

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:

  1. In the left menu, select + to create a resource.

  2. In the search box, enter storage account, select Storage account - blob, file, table, queue, and then select Create. A screenshot of what the storage account entry should look like in the resource search dialog

  3. In Name, enter mystorageacct followed by a few random numbers, until you see a green check mark that indicates that it's a unique name. A storage account name must be all lowercase and globally unique. Make a note of your storage account name. You will use it later.

  4. In Deployment model, leave the default value of Resource Manager. To learn more about the differences between Azure Resource Manager and the classic deployment model, see Understand deployment models and the state of your resources.

  5. In Account kind, select StorageV2. To learn more about the different kinds of storage accounts, see Understand Azure storage accounts.

  6. In Performance, keep the default value of Standard storage. Azure Files currently supports only standard storage; even if you select Azure Premium Storage, your file share is stored in standard storage.

  7. In Replication, select Locally redundant storage (LRS).

  8. In Secure transfer required, we recommend that you always select Enabled. To learn more about this option, see Understand encryption in-transit.

  9. In Subscription, select the subscription that was used to create the storage account. If you have only one subscription, it should be the default.

  10. In Resource group, select Create new. For the name, enter myResourceGroup.

  11. In Location, select East US.

  12. In Virtual networks, leave the default option as Disabled.

  13. To make the storage account easier to find, select Pin to dashboard.

  14. When you're finished, select Create to start the deployment.

Create an Azure file share

To create an Azure file share:

  1. Select the storage account from your dashboard.

  2. On the storage account page, in the Services section, select Files. A screenshot of the services section of the storage account; select the Files service

  3. On the menu at the top of the File service page, click + File share. The New file share page drops down.

  4. In Name type myshare.

  5. Click OK to create the Azure file share.

Share names need to 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.

Use your Azure file share

Azure Files provides two methods of working with files and folders within your Azure file share: the industry standard Server Message Block (SMB) protocol and the File REST protocol.

To mount a file share with SMB, see the following document based on your OS:

Using an Azure file share from the Azure portal

All requests made via the Azure portal are made with the File REST API enabling you to create, modify, and delete files and directories on clients without SMB access. It is possible work directly with the File REST protocol directly (that is, handcrafting REST HTTP calls yourself), but the most common way (beyond using the Azure portal) to use the File REST protocol is to use the Azure PowerShell module, the Azure CLI, or an Azure Storage SDK, all of which provide a nice wrapper around the File REST protocol in the scripting/programming language of your choice.

We expect most uses of Azure Files will want to work with their Azure file share over the SMB protocol, as this allows them to use the existing applications and tools they expect to be able to use, but there are several reasons why it is advantageous to use the File REST API rather than SMB, such as:

  • You need to make a quick change to your Azure file share from on-the-go, such as from a laptop without SMB access, tablet, or mobile device.
  • You need to execute a script or application from a client which cannot mount an SMB share, such as on-premises clients, which do not have port 445 unblocked.
  • You are taking advantage of serverless resources, such as Azure Functions.

The following examples show how to use the Azure portal to manipulate your Azure file share with the File REST protocol.

Now that you have created an Azure file share, you can mount the file share with SMB on Windows, Linux, or macOS. Alternatively, you can work with your Azure file share with the Azure portal.

Create a directory

To create a new directory named myDirectory at the root of your Azure file share:

  1. On the File Service page, select the myshare file share. The page for your file share opens.
  2. On the menu at the top of the page, select + Add directory. The New directory page drops down.
  3. 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 selected the file you would like to upload:

  1. Click on the myDirectory directory. The myDirectory panel opens.

  2. In the menu at the top, click Upload. The Upload files panel opens.
    A screenshot of the upload files panel

  3. Click on the folder icon to open a window to browse your local files.

  4. Select a file and then click Open.

  5. In the Upload files page, verify the file name and then click Upload.

  6. 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. After clicking the download button, the exact experience will depend on the operating system and browser you're using.

Clean up resources

When you're done, you can 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.

  1. In the left menu, select Resource groups.
  2. Right-click the resource group, and then select Delete resource group. A window opens and displays a warning about the resources that will be deleted with the resource group.
  3. Enter the name of the resource group, and then select Delete.

Next steps