Azure file shares are SMB storage that can be used to share files to apps or local systems. In this video, learn how to create an Azure file share, upload files, and mount it using net use.
- [Instructor] This chapter is all on Azure file shares, but before we start actually creating file shares, let's provide a quick overview of what an Azure file share is. I like to think of Azure file shares as my company share that's hosted in the cloud. We can access this file share via the SMB 3.0 protocol, and one of the biggest advantages of using an Azure file share is we can mount it on our local systems, and when I refer to a local system, I actually mean we can mount the file share to our systems that are actually on premises, or our virtual machines that are in Azure.
Let's take a look at the structure of file storage in Azure, and we start off with the account, and typically, it's the account owner. Next, we'll go ahead and create the share. In my example here, I have three shares, logs, tools, and files. From there, each share will have a directory, or directories. Again in my example here, I'm using Diagnostic Logs, Admin Tools, and Shared Files. And finally, we have files within those directories, and this structure should look very familiar, because this is how we've been handling shares since the dawn of time, or at least, since we started using shares.
One thing I wanted to point out here is the endpoint for your share. It will be HTTPS, yourstorageaccount.file.core.windows.net/Files. Now, let's pop into Azure, go ahead and create a file share, upload a file to it, and then mount that file share on a server. I'm already in a storage account called az100fs, and this is in the resource group, AZ100_FS. To create a file share, simply click File share, provide a name, and a quota.
In my case, this is going to be a very small share at five gig. That's it, I've created the share, very simple. Now, we can go ahead and either start uploading files directly to that share, or I like to add directories. And this directory will be called finance. I can now start uploading files to that directory by selecting Upload. I can select the files, I'm going to take all three, and then upload.
It doesn't take long for those files to upload. Going to close down this blade, go back to companyfiles. It's from here we can also set an access policy if we wanted to do so, for more granular access to that file share. And I mentioned that we can mount these shares, and the way to do so is by connecting, Connect, and you'll notice, we now have the commands needed to mount this file share, and we can do it through PowerShell, net use.
If you scroll down a little bit, you'll also have the commands to connect from a Linux system. We're going to keep drive letter Z, and we'll use the net use command, and before I copy this, there's one thing I want to point out here. If you're using a computer that is outside of Azure, for example, your local server, you will need to have outbound port 445 open. I'm going to go ahead, copy the net use command, to save me from typing it.
I already have a server ready to go. This happens to be a virtual machine in Azure. I'm simply going to paste that command, and you'll notice our endpoint here is az100fs.file.core.windows.net, specifying companyfiles. Also included here is our access key. We can see the command completed successfully. I'm just going to pop into File Explorer, take a look, and there's our share, our directory, and our three files.
If you haven't had the chance to play around with Azure file shares, I would highly recommend that you spend some time doing so, not only for the exam, but because this is a great way to share files between your users, and it's also the first step to configuring Azure File Sync.
- Creating and configuring a storage account
- Managing storage access keys
- Using Azure Storage Explorer
- Monitoring activity
- Implementing replication
- Creating import and export jobs
- Configuring blob storage
- Configuring an Azure CDN
- Creating a file share
- Creating a file sync service
- Implementing Azure backups
- Performing a restore of a VM or files and folders