Hello and welcome to this tutorial series of Azure Data Services. Through the course of this tutorial, I will take you through what Azure has to offer in Data Services. I will start with the basics of relational databases, dig into the goodness of non-relational offerings and end with what is new and what is exciting in Azure Data Services
Till now we have covered a wide array of topics and offerings from Azure Data Services. Today we add one more to the list (amongst many more to come). Consider the following scenarios:
Lift and Shift: You have a lot of on-prem data and you want to move to the cloud. How would you make sure that all your data gets on the cloud and can be accessed from all the VMs consistently?
Shared Application: You have a shared application. Why not centralize your configuration files, such that the shared application across VMs can access the common, consistent configuration files.
Diagnostic Share: Similar to the previous situation, but think from the VM side. How about centralizing the storage of logs, diagnostic files from VMs on one shared location
Dev/Test/Debug: Centralize the common set of diagnostic/dev/test tools which can be accessed from all VMs through file share
Based on the description above, you would have guessed that Azure File Storage is essentially a centralized location which can be shared across VMs. It is an additional component of Azure Storage Accounts. as you can see in the diagram below, the hierarchy is as follows: a storage account can have one or more shares. A share can have directories and a directory can have one or more files. The URL of the file share can be accessed using .file.core.windows.net///https://<storage-account>.file.core.windows.net/<share>/<optional-directories>/<file>
Now that we understand the functionality, lets get started and see how it is done:
Sign up for Azure Services
Have a VM (or farm of VMs) created from where you want to access the shared data
Step 1: Create Storage Account in Azure
1. Login to Azure portal (portal.azure.com). New-> Everything-> Storage –> Create Storage Account (fill in the required details)
Step 2: Create the File Share
1. Create the context for the storage account
2. Create the new share
(Note: you will have to get your Storage Account activated with File Share before you can use File Share. This can be activated here )
3. Create a directory in the share
4. Now that the file share has been created, let us upload a file on the file share.
Check and see if the file is uploaded successfully on the FileShare:
Step 3: Mount the File Share on the VM and access the file loaded:
1. Login to the VM. Let us first make sure that the File Share is a persistent drive on the VM. This is done by using the cmdkey command in the power shell of the VM.
2. Use the ‘net use’ command to add the FileShare as a network drive.
3. That’s it, now you can access the file share:
The above steps clearly show how easy it is to share a file across VMs by using Azure File Storage. This feature can be quite useful as shown in the above use cases. What we have shown above is one way of accessing the FileShare. You can also access FileShare programmatically using REST APIs. You can explore the Storage client Reference Library and File Service REST API. I will be talking about few more additional data services in this series, so stay tuned!