Load Balancing Azure Files

This proved to be difficult to find information on, so here’s a step-by-step guide to load balancing an Azure File SMB share across two IaaS web servers, in IIS.

Storage Account Setup

Once you have access to Azure Files, in your storage account you’ll see it listed like in this screenshot.

Hop on over to the Preview Portal to create the ‘share’, clicking on the storage account you’ll see this button in the next vertical blade. I named my share ‘assets’.

Cool. Now you have a SMB share. Such as mine, https://atlassetstor01.file.core.windows.net/assets

First up, you can simply try to open the SMB share via Windows Explorer, like so. Just to test things out. Oh! The Storage Account and the VM must be in the same region (but you probably knew that).

Username: [storage account name]
Password: [storage account key]

Be sure that it’s not trying to use your domain, if the VM is joined to one. A leading backslash (\) will take care of that.

Persistent authentication

So the auth is kind of a mess. Azure Files doesn’t support domain accounts, and you can’t change the permissions of the files in the share. Essentially what we are going to do next, is ‘spoof’ the credentials with a local user account on each VM.

Since we aren’t going to really use this user, other than for IIS, we need to set the authentication to be persistent, so it works between reboots.

First for your current account. This is so we can see things in IIS Manager. Open Powershell as an Admin. We’ll do these same steps here again, but running as the ‘spoof’ user. I got this part from here

Now for the ‘spoof’ local user we created. You have to ‘runas’ that user and issue the same above commands.

Setting up IIS

In IIS we will create a new website, using a new application pool, and a virtual directory in which the location is the Azure Files SMB share. Get ready for some cool.

Rinse. Repeat for each server in the Load Balance Pool.

Good luck!

Originally published at todddeland.com on May 12, 2015.

Software Engineer from Ann Arbor

Software Engineer from Ann Arbor