all Technical posts

Creating a High Available FTP Server on Microsoft Azure

This blogpost will demonstrate how to create a high-available FTP server on the Microsoft Azure platform.

There are a lot of posts available learning you how to create a singlebox FTP server on Microsoft Azure, using FileZilla Server or Internet Information Services… About a year ago, at the announcement of the general Availability of Infrastructure as a Service I tested a singlebox FTP server using FileZilla Server. The main benefit of FileZilla is it’s easy installation and configuration.

SingleBox configuration:

Following posts will guide you while creating a singlebox server using FileZilla:

http://digitalmindignition.wordpress.com/2012/11/28/azure-vm-role-with-filezilla-as-ftp-server

http://huberyy.wordpress.com/2012/08/03/set-up-a-ftp-server-in-windows-azure-virtual-machine-with-filezilla-no-coding

Azure Virtual machines need maintenance from time to time, you should always avoid a single point of failure,… Enough reasons for a High Available configuration.. This post does not consists of a step by step guide showing you how to create a VNET, VM’s, DFS,…
You need some experience with the Azure platform and Windows Server, I will help you putting the pieces together for a High Available FTP Server running on the Azure platform.

High Available Topology:

Topology

Topology remarks:
Virtual Network and Virtual Machines:
  • Create a new Virtual Network, choose a region, create an affinity group,…
  • When your Virtual Network has been provisioned, create two new Virtual Machines and add them both to the VNET.
  • When creating the first VM, create an availability set. When creating the second VM, join the availability set you just created.
  • Use the same cloudservice name for the second VM as the one you defined at creation time of the first VM.
  • When creating a new VM, the first thing you should do is changing the Windows Update and UAC settings.
  • Attach an empty datadisk to both Virtual Machines and format it. (Will be used for DFS and FTP file storage)
Active Directory:

AD Domain Services

FTP and IIS:

  • Install IIS and FTP service on both servers.
  • Configure the FTP services (publish FTP services).
  • Create a DFS share and set up Shared IIS config (you can use a shared config when doing the initial setup, when you go live you will need to disable it due to the port settings).
You will find all the information to do this on following sites:
FTP users and folders:
Should you have problems remembering how to configure user access in IIS, following posts will guide you.
If you work with a domain instead of for example local users, you need to create a folder with the domain name in IIS, don’t forget this!

https://community.rackspace.com/products/f/25/t/491

http://technet.microsoft.com/en-us/library/jj134201.aspx

Ftp User Isolation

Azure Load Balancer:
Open port 21 and load balance it between the two machines. Don’t forget to join the load balanced port on the second virtual machine!
Azure Load Balancer

Congfigure load balanced set

Now here is where the magic happens to enable passive FTP. I was not able to find any solution for this on the internet, but following did the trick. (You could use the Public Instance IP (PIP), but then your Windows Explorer clients will not be able to connect.)

You open a specific range of Passive FTP Ports on the first VM, and another specific range of ports on the second server. This way FTP traffic will always be routed to the the right server.

To avoid a lot of manual work you can use powershell to open a range of ports:

Import-Module azure
Add-AzureAccount

Select-AzureSubscription “yoursubscription”
$vm = Get-AzureVM -ServiceName “yourvmservicename” -Name “yourvm”

for ($i = 6051; $i -le 6100; $i++)
{
$name = “FTP-Dynamic-” + $i
Write-Host -Fore Green “Adding: $name”
Add-AzureEndpoint -VM $vm -Name $name -Protocol “tcp” -PublicPort $i -LocalPort $i
}

# Update VM.
Write-Host -Fore Green “Updating VM…”
$vm | Update-AzureVM
Write-Host -Fore Green “Done.”

Now you can specify the machine specific range in IIS per machine, secondly you need to specify the public IP of your cloud service in IIS. Note, deallocating both Virtual Machines will make you lose your Public IP. (Since the latest Azure announcements it’s possible in Azure to reserve your IP).

Don’t forget to allow FTP through your Windows Firewall!

Subscribe to our RSS feed

Hi there,
how can we help?

Got a project in mind?

Connect with us

Let's talk

Let's talk

Thanks, we'll be in touch soon!

Call us

Thanks, we've sent the link to your inbox

Invalid email address

Submit

Your download should start shortly!

Stay in Touch - Subscribe to Our Newsletter

Keep up to date with industry trends, events and the latest customer stories

Invalid email address

Submit

Great you’re on the list!