Azure File storage is an industry-standard SMB (2.1 and 3.0) interface that allows you to share data easily across on-premises and cloud servers. SMB is a well-known and widely adopted file system protocol today. By using this protocol, you’ll find sharing data across different components through SMB shares to be pretty straightforward.
Azure File Service enables you to create traditional file shares across all Azure datacenters. You can now simply change the configuration of your applications from on-premise file shares to Azure file shares or other way around.
The main reason for supporting SMB 3.0 and 2.1 protocols is that doing so enables a wide range of applications, including Linux resources, to work with Azure shares. However, it’s important to note that not all SMB 3.0 features are available with Azure File Storage, including SMB Direct, SMB Multichannel, and compressions. On the other hand, encryption and persistent handles work quite well with File Storage. A full list of features that are not supported is available here.
The best use cases for Azure File storage are potential cloud applications that currently use native file system APIs. Using File storage, you will have a consistent file system structure and API between cloud and on-premises that will allow you to share your data with both environments. That means any legacy enterprise application that relies on file server APIs is a perfect candidate to be migrated to Azure without changing the file service architecture.
Capacity and performance limits. ^
There are some important scalability targets for Azure file shares that you need to consider when developing solutions for your applications:
- Max size of a file share: 5 TB
- Max size of a file in a file share: 1 TB
- Max number of files in a file share: Unlimited (the only limit is the 5 TB total capacity of the file share)
- Max 8 KB IOPS per share: 1,000
- Target throughput for single file share: Up to 60 MB per second
Supported replication scenarios ^
As of today, only locally redundant storage (LRS) and geo-redundant storage (GRS) options are supported. For more information regarding replication types, take a look at my previous post.
Accessing Azure File storage ^
Azure File storage consists of several components. Under the storage account, you can have an unlimited number of SMB shares. SMB shares are used to organize files, and each SMB share can include an unlimited number of files that can each be up to 1 TB in size. Under the shares, you can create additional directories to represent the folder hierarchy.
Before accessing file shares in different ways, you must have a storage account and associated access keys.
There are several ways to manage and access Azure File storage shares.
REST APIs – HTTP endpoint
All the files stored in Azure SMB shares are accessible through the endpoint URLs. You can access a sample file, which sits on a custom directory, using the below URL structure:
Azure File storage REST API offers four main resources:
- Storage Account
Here are a few of endpoint examples:
- GET method to list a max of 5 shares:
- PUT method to create a new share:
- DELETE method to delete an existing share:
- PUT method to copy a file into an existing share:
As with the Queue REST API, there are also some mandatory request headers, such as authorization, date, and x-ms-version, which you need to provide in advance for each operation.
You can also use Azure Portal UI to create and manage Azure shares.
The New File Share wizard allows you to create a new share and set a quota of up to 5 TB.
This share can now be mounted from any endpoint that supports SMB. Simply click Connect in the upper pane and get the command to mount this share from Windows. You will also need the storage access key.
Using the above simple command, you can mount this share from an Azure virtual machine (either in the same region or in a different region) or any on-premise Windows clients.
Additional actions that are available through the panel include uploading and downloading files and creating directories.
Similar functionalities are also available via PowerShell. I explained how to get Azure PowerShell and how to create a storage account context in a previous post.
Creating and managing shares with a storage account context is pretty straightforward.
You can also use Set-AzureStorageFileContent cmdlet to upload any local file to an Azure SMB share:
Figure 9 Uploading files to Azure shares
What’s next? ^
In the next part, we are going to look at queue storage.