Filezilla Azure Blob

Posted onby admin

AzCopy is a command-line utility designed for copying data to/from Microsoft Azure Blob, File, and Table storage, using simple commands designed for optimal performance. You can copy data between a file system and a storage account, or between storage accounts. FileZilla has had 5 updates within the past 6 months. Microsoft OneDrive, Google Drive, Google Cloud Storage, Microsoft Azure Blob and File Storage, WebDAV and OpenStack Swift. FileZilla is open source software distributed free of charge under the terms of the GNU General Public License. FileZilla Pro is a commercial version, which supports additional features like WebDAV, Amazon S3, Backblaze B2, Dropbox, Microsoft OneDrive, Google Drive, Microsoft Azure Blob and File Storage, and Google Cloud Storage. Azure Blob Storage doesn’t work like a traditional disk-based system in that it doesn’t actually have a hierarchical directory structure – but the FTP service simulates one so that FTP clients can work in the traditional way. How to connect to Microsoft Azure. Get your access key from the Microsoft Azure Dashboard Portal site, by clicking on the link to the Dashboard website. Create a site entry for your S3 connection, to do that click New in the Site Manager dialog box to create a new. Select Microsoft Azure File.

A pure go FTP Secure server with support for local file system and Microsoft Azure Blob storage.

The interface based file system makes easy to support different file systems. Please tell me if you are interested in something not covered here.

Features

Filezilla

This server implements most - not all - the FTP commands available. This should be enough for most passive clients, below you will find a tested program list.

The main features are:

  • Local file system support (ie standard FTP)
  • Azure blob storage backed file system
  • Unsecure (plain) FTP
  • FTP Secure explicit
  • FTP Secure implicit
  • File system agnostic
  • Azure nested directory support (thanks to Shuichiro MAKIGAKI)
  • Pluggable logging system (thanks to logrus)

Implemented commands

CommandSince version
USER1.0
PASS1.0
PWD1.0
TYPE1.0
PASV1.0
EPSV1.0
LIST1.0
SYST1.0
CWD1.0
CDUP1.0
SIZE1.0
RETR1.0
STOR1.0
DELE1.0
FEAT1.0
QUIT1.0
NOOP1.0
MKD1.0
RMD1.0
REST1.0
AUTH1.0
PROT1.0
NLST1.1
LIST nested1.1
CWD nested1.1
MKD nested1.1

This list may not be updated: please refer to session.go source file to the updated list.

How to build

The main FTP server object can be called on its own in your project. Here, however, I give you a very simple program to test it. In order to use it download it, compile it and launch it. Here we suppose you have installed GO on your build machine and have the GOPATH environment variable set.

Blob

Download

With this command you can download the code with all its references. You can also use it later to update to the latest source code:

Get Azure Blob Url

Build

To build the application use this code. The binary will be saved in the %GOPATHbin folder ($GOPATH in linux):

Use

Here we assume you have a folder called ftphome in your C: disk. Substitute it with your FTP home folder.

Windows

Blob

Linux

Here we assume you have a folder called /mnt/ftphome on your file system. Substitute it with your FTP home folder.

You need to be su in order to listen on port 21 (standard FTP command port). If you use another port you can start the program without sudo. Check the parameters section for how to do it.

Azure blob storage

Filezilla Azure BlobAzure function sftp to blob

In order to have the FTP server serve the azure storage blobs simply replace the -lfs parameter with -ak and -an like this:

More info on the parameters in the Parameters section.

Some screenshots

Ftp To Azure Blob Storage

This is an example of execution in ubuntu:

As you can see here, TLS is available (it's up to you to use valid certs however):

Here is how an Azure storage account appears in Chrome:

Parameters

At any time you can call the executable with -help flag in order to be reminded of the parameters.

FlagTypeDescriptionDefault
anstringAzure blob storage account name (1)nil
akstringAzure blob storage account key (either primary or secondary) (1)nil
crtstringTLS certificate file (2)nil
keystringTLS certificate key file (2)nil
lDebugstringDebug level log filenil
lErrorstringError level log filenil
lInfostringInfo level log filenil
lWarnstringWarn level log filenil
lfsstringLocal file system root (3)nil
llstringMinimum log level. Available values are Debug, Info, Warn, ErrorInfo
maxPasvPortintHigher passive port range50100
minPasvPortintLower passive port range50000
plainPortintPlain FTP port (unencrypted). If you specify a TLS certificate and key encryption you can pass -1 to start a SFTP implicit server only21
tlsPortintEncrypted FTP port. If you do not specify a TLS certificate this port is ignored. If you specify -1 the implicit SFTP is disabled990

Notes

1.These two flags must be specified together. If you need to retrieve the storage account key look here http://stackoverflow.com/questions/6985921/where-can-i-find-my-azure-account-name-and-account-key. You cannot both specify this flags and the local file system one (lfs).

2.These two flags must be specified together. Without either one the secure extensions of FTP will be disabled. This article (http://stackoverflow.com/questions/12871565/how-to-create-pem-files-for-https-web-server) explains how to generate both the certificate file and the key one.

Filezilla Azure Vm

3.You cannot both specify this flag and the azure storage ones (an and ak).

ToDo

Filezilla Azure Blob Server

  • Better tests. Coverage is abysmal. Script unit testing for a distributed state machine such as FTP is a PITA though.
  • File access privilege check (right now is ignored).
  • Authentication. Right now the FTPServer delegates authentication to the caller but the provided executable does not validate the passed identity.

Tested clients

PC

Azure Blob File Explorer

  • FileZilla.
  • Chome.
  • Firefox.
  • Internet Explorer.

Android

License

Please refer here: LICENSE.

Contributing

Azure Function Sftp To Blob

If you want to contribute please do so, just fork and ask for merge. An huge thank you to everyone contributing (please see here the GitHub contributors page for their names).