Thursday, September 25, 2014

Microsoft Azure Files service

I've recently learned of a preview feature called Azure Files on Microsoft Azure:
"Azure Files allows Virtual Machines (VMs) in an Azure Data Center to mount a shared file system using the SMB protocol. These VMs will then be able to access the file system using standard Windows file APIs (CreateFile, ReadFile, WriteFile, etc.). Many VMs (or Platform as a Service (PaaS) roles) can attach to these file systems concurrently, allowing you to share persistent data easily between various roles and instances."

This sounds useful. One annoyance so far I have with Azure is that I have to download/upload software I want to install every time I build a new VM. I've always wanted to have a  Share of some sort for it. (I could create a VM to just hold the file, but it's inconvenient and also incurr computing charges.)
Now let's make this happen...

First of all, go to this site. Look for Azure Files there and tell them you want to try it. Then I got an email telling me that I have to create a new Storage account on Azure to try it.

Once I'm done, I notice that the under the storage account dashboard there is a new entry called "Files".

Then, it's time to create the File share. I already have the Microsoft Azure Powershell module installed (If you need it, find it here)
Run the following scripts in PowerShell.
# <account name> is the name of the storage account 
# <account key> is acquired by clicking "Manage Access Key" at the bottom when viewing the 
# Storage account dashboard 
# <share name> is just a name you make up for the file share
$ctx = New-AzureStorageContext <account name> <account key>
$s = New-AzureStorageShare <share name> -Context $ctx

Finally, remote to a VM on Azure, and type the following in a command prompt to mount the file share.
net use S: \\<account name>\<share name> /u:<account name> <account key>
And I got what I want. =]

P.S. For a more thorough description of this new Azure File service, you should check this link.

This posting is provided "AS IS" with no warranties, and confers no rights.

No comments:

Post a Comment