PageRenderTime 113ms CodeModel.GetById 41ms app.highlight 42ms RepoModel.GetById 1ms app.codeStats 0ms

Markdown | 141 lines | 91 code | 50 blank | 0 comment | 0 complexity | 19287dff08075160903ec5307f46ba5a MD5 | raw file
  2	pageTitle="How to use Azure Files with Linux | Microsoft Azure"
  3        description="Create an Azure file share in the cloud with this step-by-step tutorial. Manage your file share content, and mount a file share from an Azure virtual machine (VM) running Linux or an on-premises application that supports SMB 3.0."
  4        services="storage"
  5        documentationCenter="na"
  6        authors="mine-msft"
  7        manager="aungoo"
  8        editor="tysonn" />
 10<tags ms.service="storage"
 11      ms.workload="storage"
 12      ms.tgt_pltfrm="na"
 13      ms.devlang="na"
 14      ms.topic="article"
 16"minet" />
 19# How to use Azure File Storage with Linux
 21## Overview
 23Azure File storage offers file shares in the cloud using the standard SMB protocol. With Azure Files, you can migrate enterprise applications that rely on file servers to Azure. Applications running in Azure can easily mount file shares from Azure virtual machines running Linux. And with the latest release of File storage, you can also mount a file share from an on-premises application that supports SMB 3.0.
 25You can create Azure file shares using the [Azure Portal](, the Azure Storage PowerShell cmdlets, the Azure Storage client libraries, or the Azure Storage REST API. Additionally, because file shares are SMB shares, you can access them via standard file system APIs.
 27File storage is built on the same technology as Blob, Table, and Queue storage, so File storage offers the availability, durability, scalability, and geo-redundancy that is built into the Azure storage platform. For details about File storage performance targets and limits, see [Azure Storage Scalability and Performance Targets](
 29File storage is now generally available and supports both SMB 2.1 and SMB 3.0. For additional details on File storage, see the [File service REST API](
 31>[AZURE.NOTE] The Linux SMB client doesn’t yet support encryption, so mounting a file share from Linux still requires that the client be in the same Azure region as the file share. However, encryption support for Linux is on the roadmap of Linux developers responsible for SMB functionality. Linux distributions that support encryption in the future will be able to mount an Azure File share from anywhere as well.
 33## Video: Using Azure File storage with Linux
 35Here's a video that demonstrates how to create and use Azure File shares on Linux.
 37> [AZURE.VIDEO azure-file-storage-with-linux]
 39## Choose a Linux distribution to use ##
 41When creating a Linux virtual machine in Azure, you can specify a Linux image which supports SMB 2.1 or higher from the Azure image gallery. Below is a list of recommended Linux images:
 43- Ubuntu Server 14.04+
 44- RHEL 7+
 45- CentOS 7+
 46- Debian 8
 47- openSUSE 13.2+
 48- SUSE Linux Enterprise Server 12
 49- SUSE Linux Enterprise Server 12 (Premium Image)
 51## Mount the file share ##
 53To mount the file share from a virtual machine running Linux, you may need to install an SMB/CIFS client if the distribution you are using doesn't have a built-in client. This is the command from Ubuntu to install one choice cifs-utils:
 55    sudo apt-get install cifs-utils
 57Next, you need to make a mount point (mkdir mymountpoint), and then issue the mount command that is similar to this:
 59     sudo mount -t cifs // ./mymountpoint -o vers=3.0,username=myaccountname,password=StorageAccountKeyEndingIn==,dir_mode=0777,file_mode=0777
 61You can also add settings in your /etc/fstab to mount the share.
 63Note that 0777 here represent a directory/file permission code that gives execution/read/write permissions to all users. You can replace it with other file permission code following Linux file permission document.
 65Also to keep a file share mounted after reboot, you can add a setting like below in your /etc/fstab:
 67    // /mymountpoint cifs vers=3.0,username= myaccountname,password= StorageAccountKeyEndingIn==,dir_mode=0777,file_mode=0777
 69For example, if you created a Azure VM using Linux image Ubuntu Server 15.04 (which is available from the Azure image gallery), you can mount the file as below:
 71    azureuser@azureconubuntu:~$ sudo apt-get install cifs-utils
 72    azureuser@azureconubuntu:~$ sudo mkdir /mnt/mountpoint
 73    azureuser@azureconubuntu:~$ sudo mount -t cifs // /mnt/mountpoint -o vers=3.0,user=myaccountname,password=StorageAccountKeyEndingIn==,dir_mode=0777,file_mode=0777
 74    azureuser@azureconubuntu:~$ df -h /mnt/mountpoint
 75    Filesystem  Size  Used Avail Use% Mounted on
 76    //  5.0T   64K  5.0T   1% /mnt/mountpoint
 78If you use CentOS 7.1, you can mount the file as below:
 80    [azureuser@AzureconCent ~]$ sudo yum install samba-client samba-common cifs-utils
 81    [azureuser@AzureconCent ~]$ sudo mount -t cifs // /mnt/mountpoint -o vers=3.0,user=myaccountname,password=StorageAccountKeyEndingIn==,dir_mode=0777,file_mode=0777
 82    [azureuser@AzureconCent ~]$ df -h /mnt/mountpoint
 83    Filesystem  Size  Used Avail Use% Mounted on
 84    //  5.0T   64K  5.0T   1% /mnt/mountpoint
 86If you use Open SUSE 13.2, you can mount the file as below:
 88    azureuser@AzureconSuse:~> sudo zypper install samba*  
 89    azureuser@AzureconSuse:~> sudo mkdir /mnt/mountpoint
 90    azureuser@AzureconSuse:~> sudo mount -t cifs // /mnt/mountpoint -o vers=3.0,user=myaccountname,password=StorageAccountKeyEndingIn==,dir_mode=0777,file_mode=0777
 91    azureuser@AzureconSuse:~> df -h /mnt/mountpoint
 92    Filesystem  Size  Used Avail Use% Mounted on
 93    //  5.0T   64K  5.0T   1% /mnt/mountpoint
 95## Manage the file share ##
 97The [Azure Portal]( provides a user interface for managing Azure File Storage. You can perform the following actions from your web browser:
 99- Upload and download files to and from your file share.
100- Monitor the actual usage of each file share.
101- Adjust the file share size quota.
102- Copy the `net use` command to use to mount your file share from a Windows client.
104You can also use the Azure Cross-Platform Command-Line Interface (Azure CLI) from Linux to manage the file share. Azure CLI provides a set of open source, cross-platform commands for you to work with Azure Storage, including File storage. It provides much of the same functionality found in the Azure Portal as well as rich data access functionality. For examples, see [Using the Azure CLI with Azure Storage](
106## Develop with File storage ##
108As a developer, you can build an application with File storage by using the [Azure Storage Client Library for Java]( For code examples, see [How to use File storage from Java](
110You can also use the [Azure Storage Client Library for Node.js]( to develop against File storage.
112## Feedback and more information ##
114Linux users, we want to hear from you!
116The Azure File storage for Linux users' group provides a forum for you to share feedback as you evaluate and adopt File storage on Linux. Email [Azure File Storage Linux Users]( to join the users' group.
118## Next steps
120See these links for more information about Azure File storage.
122### Conceptual articles and videos
124- [Azure Files Storage: a frictionless cloud SMB file system for Windows and Linux](
125- [Get started with Azure File storage on Windows](
127### Tooling support for File storage
129- [Transfer data with the AzCopy Command-Line Utility](
130- [Create and manage file shares]( using the Azure CLI
132### Reference
134- [File Service REST API reference](
136### Blog posts
138- [Azure File storage is now generally available](
139- [Inside Azure File Storage](
140- [Introducing Microsoft Azure File Service](
141- [Persisting connections to Microsoft Azure Files](