In this post, I will be exploring the Azure Files Storage Services to manage files by using the SMB (Server Message Block) protocol. The most relevant part of the use of this service is that you can attach it to a virtual disk on your Windows machine to deal with files as it were an external disk. Besides, you can make use of this service by using the proper REST APIs services in a similar way described in the post Azure BLOB Storage Services.
What is SMB protocol?
The Server Message Block (SMB) protocol is a network file sharing protocol that allows applications on a computer to read and write to files and to request services from server programs in a computer network. The SMB protocol can be used on top of its TCP/IP protocol or other network protocols. Using the SMB protocol, an application (or the user of an application) can access files or other resources at a remote server. This allows applications to read, create, and update files on the remote server. It can also communicate with any server program that is set up to receive an SMB client requests.
Set up Azure Files Storage Services over SMB protocol
These are the steps to set up the files service:
Step 1: Go to Azure Portal -> Storage Account and then, select the concrete storage account you want to store your Azure Files Service. In my case, the storage account name is st001jamuroblogengine as you can see below.
Step 2: Select the Azure File shares service tile
Step 3: On the next screen, click add File Share button and enter the Name and Quota:
Step 4: Select your files service in the grid and then, click Connect button
After clicking Connect button, you will see the following on the right side:
Step 5: Copy the above content from the box in gray in order to use it later to map the network drive
Step 6: Open a PowerShell console, paste the previously copied text and then, run the commands.
If you can connect...congratulations! you can use that network disk like any other in your computer.
Otherwise, check that you are getting a valid response from the azure server. If port 445 for TCP is not open, you will get an error as the one displayed below:
You have to bear in mind the following warning we get before configuring the Azure file service:
Overview of file sharing using the SMB 3 protocol in Windows Server | Azure Files