Creating FTP Server On Windows Azure

Using the new Windows Azure 1.3 SDK and the RDP support, you can create your own FTP server in the cloud within less than 30 minutes! Here is a little guide how to do so:

The three major steps are to open the necessary FTP ports to the virtual server, enable RDP on the virtual server and configure the FTP server role on the virtual server.

  1. Download and install the Windows Azure 1.3 SDK
  2. Create a new Windows Azure Project in Visual Studio 2010 and add a Role to that project. In fact it doesn’t matter what kind of role you add to the project. I started by adding a ASP.NET Web Role.
  3. In the Solution Explorer, right click on the WebRole and choose Properties
  4. In the Endpoints tab on the Properties page add a second endpoint that uses the public port 21 (which is the default port for FTP)
  5. Now right click on the Cloud Project in the Solution Explorer and choose Publish+
  6. In the publishing dialog select the option “Deploy your Windows Azure project to Windows Azure” and select the credentials, the deployment environment and the storage account you want to use for the deployment. Then
  7. click on “Configure Remote Desktop connections…”
  8. Check the option “Enable connections for all roles”, select or create a certificate that will be used for the RDP connection and provide a user name and password. This user name and password will grant you administrative rights via remote desktop on the server.
    Close the dialog and publish your Windows Azure project to the cloud.
  9. After the publishing visit the Windows Azure Management Portal, select the server instance of your Windows Azure project and click on the Remote Desktop Connect button.
    You can either open the .rdp file directly or save it to your computer for later use without having to go to the Management Portal again.
  10. Login to the server with the user name and password you provided in step.
    Hint: use “\” to remove domain information for the login
    On the server you first need to remove the binding to port 21 from the IIS default website. Go to: Start > Administrative Tools > Internet Information Services (IIS) Manager, navigate to the only web site in the tree on the left and click on the “Bindings…” link in the Actions pane on the right.
  11. Remove the binding to port 21.
  12. Close the bindings window and close the IIS Manager
  13. Go to: Start > Administrative Tools > Server Manager
  14. Navigate to the Web Server (IIS) Role in the tree on the left and click on “Add Role Services” in the right part of the window.
  15. Select the role service “FTP Publishing Service”. This should select the services “FTP Server” and “FTP Management Console” automatically, too. If not, select all three manually. If necessary, add required role services pointed out by the wizard.
  16. Click “Next” and then “Install”.
  17. Go to: Start > Administrative Tools > Internet Information Services (IIS) 6.0 Manager This tool is used to manage FTP on the server.
  18. Expand the tree on the left to the “Default FTP Site”, right click the Default site and
  19. Start the FTP Default Site. When the IIS6 Manager asks you if it should start the FTP Publishing Service, click “Yes”.
    To check if your FTP server is working, open a Command Shell (either on the server or on your local machine) and connect to your server. Use the same credentials for the FTP connection as for the RDP login.
    You can find the address of your FTP server in the title bar of the RDP window.

Issues:

  • For using passive FTP functionality you need to open up more FTP related ports.
  • When the cloud fabric decides to shut down your server, reboot it or move it to another physical machine, all changes you made via RDP are lost! You might solve this by creating startup scripts or upload a pre-configured server image.
  • When your server is restarted or moved all locally stored files are deleted, too. So you need to store the FTP uploads somewhere persistently.

Mayur Gondaliya - CTO - CaseTronyx, Inc. Director - ExaSpring Information Services Pvt. Ltd. Web Investor. Software Engineer. Workaholic. Insomniac.

3 Comments

  1. [...] When your server is restarted or moved all locally stored files are deleted, too. So you need to store the FTP uploads somewhere persistently. ????: http://mayur.gondaliya.com/microsoft/creating-ftp-server-on-windows-azure-493.html [...]


  2. Eric
    Apr 01, 2012

    There has a problem, if you do not create FTP by code, then you will lose everything with next deployment


  3. Danny
    Apr 24, 2012

    Hi,

    I’m using VS 2010 Express.
    I installed all possible components related to Azure and when I start a new project, I can choose Windows Azure Project but I keep on getting the following error message.
    “Creating projects requires Windows Azure Tools v1.6 to be installed.”

    Windows Azure Tools V1.6 is installed and appears in the Programs and Features window
    I’ve re installed everything, rebooted several times already and nothing

Leave a Reply

Live Chat Support

LiveZilla Live Help

Subscribe Now

Enter your email address: