Mount Azure Blob Storage as a Windows Drive

Do you need to access blobs as files from your local computer or Azure? AzureBlobDrive solves this problem by mounting blob storage as drive in Windows. Containers appear as a folders, each blob is displayed as a file:

AzureBlobDrive can run either on an Azure instance, or on your local machine.

Works well for these scenarios:

+ If you have an existing application which you want to migrate to Azure, but it needs to read/write to a persistent drive.

+ If you have an application split across Azure and a local data centre, and they need to share files.

+ If you want convenient access to blobs and containers from your local computer.

Not suitable for these scenarios:

  • Reading/writing large files.
  • Storing files that change a lot (i.e. database files).

Demonstration

Run locally

  1. Install the Dokan driver, which can be downloaded from here: http://dokan-dev.net/wp-content/uploads/DokanInstall_0.6.0.exe
  2. Download the AzureBlobDrive source: https://github.com/richorama/AzureBlobDrive
  3. Update the app.config file in the Two10.AzureBlobDrive.Console project, to point to your Azure storage account (alternatively you can use the Azure emulator).
  4. Run the Two10.AzureBlobDrive.Console project. An ‘R’ drive will be mounted, you should be able to see your containers.

Run in Azure

  1. Download the AzureBlobDrive source: https://github.com/richorama/AzureBlobDrive
  2. Update the Two10.AzureBlobDrive.Console.exe.config in the Two10.AzureBlobDrive.WorkerRole project, to point to your Azure storage account.
  3. Build the solution.
  4. Publish the Two10.AzureBlobDrive.CloudProject project to Azure, the role will install the Dokan driver with an elevated startup command, and the worker role will mount the ‘R’ drive in the ‘Run’ method.

Current limitations

AzureBlobDrive is alpha quality code, and has a number of limitations. Some of these limitations are passed on by the inherent limitations of Azure blob storage.

  • Files can only be placed in a folder (container). You cannot have files in the root directory.
  • Folders cannot contain folders (blob storage does not support hierarchy).
  • Root folder names (containers) must be in lower case, and cannot contain spaces and other special characters.
  • Performance is poor, and large files are not recommended.
  • Files and folders are cached for one minute, so changes made by other machines may not be instantly viewable.
  • Files (blobs) cannot be empty (i.e. have a zero size).

How does it work?

AzureBlobDrive uses the Dokan file system driver (http://dokan-dev.net/en/). Dokan provides you with an interface for calls to the file system, such as ReadFile, WriteFile etc… The Two10.AzureBlobDrive project contains a class which implements these methods, accessing blob storage to retrieve the information. The Azure Worker Role is configured to install the Dokan dependencies (Startup.cmd), and then start the Two10.AzureBlobDrive.Console application as a background task.
Some of these limitations will be improved over time. Feel free to fork the repo!

About these ads