Thursday, March 29, 2012

Blob Drop: Sync Local Files to Windows Azure Blob Storage

I'm pleased to announce a new community donation, Blob Drop. Blob Drop is a Windows Service that monitors a file folder and pushes file changes up to a blob container in Windows Azure Storage. Currently, this sync is only in one direction, up to the cloud.

Here's how Blob Drop works:

• Configuration: the folder to watch, blob storage account to use, and blob container are specified in the config file for the service.
• Initial Sync: upon initializing, blob drop will scan the folder it is configured to watch and see if any files in it are missing in the blob container - if there are, it queues upload tasks for itself.
• Ongoing Sync: Blob Drop watches for file events on the drop folder (file creates, updates, renames, deletes) and queues corresponding upload or delete tasks for itself.
• A pool of background worker threads handle queued tasks, such as uploading a file or deleting a blob.


Blob Drop Service

To install the service, run installutil BlobDropService.exe from a command window. After installation the service will be visible in the Services control panel. By default, the user is LocalSystem and start-up is Manual. To uninstall, run installutil -u BlobDropService.exe from a command window.



Blob Drop Command

There is also a console command edition of Blob Drop. It can do what the service does, with the added benefit that you can see activity on the console (see below). You can also run the console command with an option to just do an initial sync and exit. With the command line edition, you can use config-based parameters or specify them on the command line.

BlobDrop -r
BlobDrop -r <folder> <storageAccountName> <storageAccountKey>

BlobDrop -r runs the service as a console app, with visible display of activity. If parameters are specified on the command line, they are used in place of configuration settings.


As files are added, changed, or deleted from the drop folder, file events are detected and blob actions are triggered.


If BlobDrop encounters file system errors, blob storage errors, or file-in-use errors, it will dutifully retry the operation a number of times before giving up.



BlobDrop -s
BlobDrop -s  <folder> <storageAccountName>  <storageAccountKey>

BlobDrop -s runs an initial sync and then exits.


BlobDrop -h

BlobDrop -h or -? displays help.


You can verify your files have made it into blob storage using an explorer tool such as Cloud Storage Studio or Azure Storage Explorer.



This is the initial drop of Blob Drop. As Blob Drop is new and has not yet been heavily tested, please treat this as prototype code and protect your data.

Blob Drop is another community donation from Neudesic. For support or inquiries, contact me through this blog.

2 comments:

Ben Osborne said...

Hi David,

Looks like a useful tool. How hard would it be to be able to specify the container on Azure that the files should be synced with ?

We use multiple containers in a single storage account, and would like to setup multiple sync processes for these containers.

Thanks again for the release.

Cheers,
Ben

Anonymous said...

Hi David,

This is a looks like a great tool but i am having issues getting it to run as a service can you post a example of the config file so i can confirm i am using the right settings because the service fails to start everytime i try to get it to

thanks

Bhav