This post is authored by Lalitesh Kumar, Pradeep M G and reviewed by Avinash Venkat Reddy.
FTP may run in active or passive mode. Passive mode is extensively used to solve the issue of the client firewall blocking the FTP server data connection. Detailed information on FTP server modes here.
Setting up a Passive FTP server in Windows Azure VM involves the following steps:
Note: If you are new to using Windows Azure then here are the detailed steps to provision a Windows Server VM and RDP to it.
2. From Installation Type tab select Role based or feature-based installation and click Next. 3. From Server Selection tab select the server on which you want to enable FTP and click Next. 4. From Server Roles tab select Web Server (IIS), you will be presented with the Add Roles and Features Wizard.Click Web Server (IIS) and then click Add Features.
5. Click Next on the Features and Web Server Role (IIS) tabs.
6. From Role Services tab select FTP Server and FTP Service and click Next.
7. From Confirmation tab click Install and wait for the installation to complete.
5. Click Apply. You will be prompted to configure the firewall to allow FTP access.
6. To make sure that FTP server has taken all the setting we added, let's stop and start the FTP service.
Note: iisreset does not restart the FTP service as it is outside the IIS.
Ports 1035 to 1040 should also be added as endpoint to the Azure VM. You can add multiple ports as endpoint to the VM using Windows Azure PowerShell. Detailed procedure here.
You can also add endpoints using the management portal. Detailed procedure here.
To confirm that the said ports are added to the VM, please check the endpoint list on portal for the said VM.
Note: You also would need add port 21 to the endpoint list which is command port for FTP connection.
For ports added as endpoints in the above procedure, no configuration is done automatically to the firewall in the guest operating system. When you create an endpoint, you'll need to configure the appropriate ports in the firewall to allow the traffic you intend to route through the endpoint.
In this case I have disabled the Windows firewall for simplicity. You can refer here to modify the firewall rules to allow traffic on the ports added as end points.
We are now done setting up the passive FTP Server on a Windows Azure VM.
The first four steps and the fifth step are general steps which you should complete to setup a passive FTP on a Windows server however the 4th step is specific to Windows Azure. Another point to note is that currently Windows Azure only support 150 endpoint. Keep this in mind when adding endpoints. The last step is just a verification step where we trying to conclude that the FTP server is actually using the ports that we specified.
Hope this post was helpful!