Setting up FTP on our Azure VM is precisely why we’re doing this series: the downside of managing a server when you’re not an IT pro is that when something doesn’t work, you start looking for solutions and trying things and opening up ports and trying more things and pretty soon your function works, but you’ve left yourself some pretty big security holes, or worse.
So we’re going to walk through some steps to get Active FTP running, and then point you to some resources to learn about setting up passive FTP, which can be more secure, but is definitely trickier to set up on Azure.
In short, the steps are:
- Set up FTP access in the Azure Portal
- Install FTP on the Server (VM)
- (Install IIS)
- Add an FTP Site
- Connect using Active FTP
The first thing we’re going to do is double check that FTP is enabled in Azure. Open the Azure portal, then double click on your VM, then open EndPoints. If you followed the earlier tutorials, you should have FTP installed. If not, install it, using port 21.
Then we’re going to do is double check that the FTP services we installed when we first set up the server on Azure are installed correctly. RDP into the server, and open up Server Manager, and then “Manage”, in the top right corner:
We need to check on the FTP Server installation, so click on Add Roles and Features, then click through to the list of features, and expand the FTP Server:
Make sure the FTP Service is enabled. If not, check them, and complete the wizard. If it’s enabled, you can safely cancel out. FTP Extensibility is not necessary.
If you don’t have the FTP Server properly installed, and/or you don’t have FTP set up in Azure, you’re not going to get FTP working, and we don’t wish our frustration on anyone!
Once you ensure that you’re set up properly, however, the rest is pretty easy. Open up the IIS (7) Manager, and pin it to your Start Screen while you’re at it. Click down to “Sites”, right click and Add an FTP site:
Add your website, naming it something that will remind you it’s the FTP site, and point the physical path to c:\inetpub\wwwroot, where you have your website installed if you followed along at home:
Of course you can install your website(s) and FTP folders anywhere on the server, but you need to make sure you’ve enabled your permissions properly. Using wwwroot just saves a few steps, and a few headaches.
Next you’ll set the bindings and SSL settings. You can leave the bindings alone for this demo, and we chose to Allow SSL, choosing the pre-installed SSL certificate:
Next we’ll set up Authentication. Unless you want anyone to be able to access your FTP folder, choose Basic Authentication, and allow access to Administrators:
Make sure you’ve spelled Administrators correctly, click Finish, and you’re done.
We had some issues setting up FTP, let us know if you have trouble, and we’ll see what we can do to help.
What we’ve done is set up Active FTP, which needs a little help on the client side to make it work. You can read more about the differences between Active and Passive FTP, but unless you’re ready to tackle the more complicated job of setting up Passive FTP on Azure, using Active FTP should work fine.
You will need to set up your client, however. If you’re using a browser, you’ll need to uncheck “Use Passive FTP” in the settings. We strongly suggest you install and use FileZilla, and just tell it to use Active FTP. In File>Site Manager>Transfer Settings (using Auto isn’t enough, you need to explicitly choose Active):
If you’re using FileZilla for the first time, you may have to allow access through your Firewall, but you should get a prompt.
In Site Manager>General, use your xxx.cloudapp.net address (if you’ve set FTP up under Port 21, you can leave that blank). Choose Normal for Login Type, and input your Server Login settings.
We’re almost ready to turn you loose on your Azure VM. In our next installment, we’ll touch on a few pain points that will make it easier for you to manage your new installation, but we’re almost there!