This post shows how to create an SMB file share using Azure storage, that you can then use as a mounted drive on a remote server (such as your on-premise SQL Server machine, or a VM), using the Azure portal and File Explorer UIs.
For a guide on how to do that same thing using PowerShell, see this post.
Creating a storage account
In your Azure portal, select the “Storage Accounts” option on the left-hand menu.
Click the “+ Add” button that appears on the “Storage Accounts” page. This should bring up the “Create Storage Account” page shown below.
Fill out the relevant boxes on the “Create Storage Account” page, using an existing Resource Group, or creating a new one. I’ve just accepted the defaults for the other options (performance tiers, etc).
Your storage account name can only consist of numbers and lower-case letters, be between 3 and 24 characters in length, and will need to be unique across Azure.
Click “Review + Create”, followed by “Create”. You should see your new storage account being deployed. Once it has been created, click on the new storage account name
You should then see a “Files” box in the Overview section, as shown below:
After selecting the “Files” box, and then “+ File Share”, you have the option to name and size a new file share, as below. Click “create” to do so.
Once the new file share is created, click it’s name (“dataministerfileshare02” in the example below).
On the screen that appears, showing your new file share details, you need to click the “Connect” option from the menu. This will show you a pane of connection information that will be required when you come to set up a connection to the file share.
The two commands in the “Connect” window provide connection strings that you can use when connecting via Powershell, and via Command Prompt. Here we are going to use the File Explorer UI to mount the file share, but we’ll use some of the info given in the connection string provided by Azure…
…this consists of the UNC filepath of the Azure file share, the storage account name, and storage account key (which I have very artistically graffiti-ed out in the screenshots).
Armed with this info, connect to the server that you want to set up a mapping to the file share from, and open a File Explorer window. Connect to “This PC”, “Computer”, and then “Map network drive”.
Insert the UNC file path provided by Azure in the “Connect” screen we saw earlier (it will be the string of characters that comes after “Net use Z:”, that begins with “\\) into the “Folder” box, as below:
Make sure the “Connect using different credentials” box is ticked, and click “Finish”. The dialogue box below will appear. Enter the storage account name as the User Name, this is again shown in the connection strings provided by the Azure portal that we saw earlier. It will be the name shown after “/u:”, in this example “AZURE\dataministerstorage02”. Enter the storage account key as the password, this was the part that was graffiti-ed out in the connection string screenshot.
Click OK to mount the file share. The file share should now be mounted as a drive on your server:
You can drag and drop files to this new “drive”, just as you would to a folder on your server…
…and they’ll be uploaded to your Azure storage account:
Note: You may have noticed in the “Connect” screenshot there was a message from Azure about a potential issue that could stop the process above working first time: “When connecting from a computer from outside Azure, remember to open outbound TCP port 445 in your local network. Some Internet service providers may block port 445. Check with your service provider for details. “
To carry out this process using Powershell, see this alternative guide.