Deploy an FTP Server in Azure

Over the following post we’ll deploy a basic FTP server which I used for testing my FTP to Azure Blob Logic App. The FTP server has some extra ports opened to support passive FTP which is a requirement for Logic Apps.

Pre-Reqs

Before we start you will need to come up with two usernames and passwords – the first will be the machine Administrator, the second will be the username and password for the FTP user. Make a note of these and use them as required later on.

Deploy the VM

Once you have logged on to the portal click on click on New -> type Windows Server 2016 Datacenter – on the results list select Windows Server 2016 Datacenter and click Create:

On the settings blade that opens up enter details for:
Name
User name
Password
Resource Group – Choose Create New and enter rgFTPServer
• Select your Location

Click OK

Now choose a Size – I chose DS1_V2 Standard, simply accept the defaults on the Settings page and click OK

The VM will now be provisioned.

Configure the Network Security Group

In order for the Logic App to be able to connect to the FTP server and transfer files we need to open the required ports. We’ll do this now to save us having to come back to the portal later so when complete:

Open the VM in the portal and under Settings select Network interfaces
Select the network interface and on the Network interface blade under Settings select Network security group and select the network security group that was provisioned at deployment

On the NSG blades under Settings click Inbound security rules and on the blade click Add

For the first rule enter:
Name e.g., allow-ftp-in
• For Service select FTP
• click OK

We now need to add another rule to support the passive FTP ports and for this enter:
Name e.g., allow-ftp-pasv-in
Port range: 1035-1041
• Click OK

Provision the FTP Server

In the portal open the VM overview blade and click Connect:

Once you have logged in to the server Server Manager should launch (if it does not open Server Manager from the Start menu) click Add roles and features click Next until you reach the Select server roles screen.

Select “Web Server (IIS)” click Add Features when it opens and click Next until you are on the Select role services screen. Scroll down and check FTP Server click Next and Install

Click Close on the wizard when it finishes

Add FTP User

Open Computer Management (you can right-click on the Start button)
Expand Local Users and Groups, right-click on Users and select New User…

Make sure you clear the User must change password at next logon

Open Internet Information Services (IIS) Manager from the Tools menu of Server Manager

Right-Click on Sites and select Add FTP Site…

Give the site a name and assign a folder to host the site

Click Next
Change the SSL option to No SSL

Click Next
Under Authentication check Basic and for Authorization set Allow access to: Specified users and enter the FTP username you created earlier – for Permissions check Read and Write

Click Finish

Click on the server in IIS Manager and click on FTP Firewall Support

For External IP Address of Firewall enter the IP address of the server – you can easily see this on the RDP ribbon – its the IP address you connected to:

For Data Channel Port Range enter 1035-1041

Click Apply (Right hand side of the screen)

Finally you will need to check for updates and install them after rebooting the server you should be able to test the FTP connection

No Comments

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.