We want to provide an update for Linux users on how to use Azure Storage, and we are pleased to announce some new options. Currently, we are testing with Ubuntu 14.04; we will look at feedback to determine which additional distros to include over time.
Our Java library, which we announced the General Availability for earlier this year, has now been fully stress-tested with Linux. You can get the latest Java library through Maven (http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22azure-storage%22) or as source code (https://github.com/Azure/azure-storage-java).
We released an updated Node.js library earlier this year, in preview for both Windows and Linux. You can get the node.js library through npm (https://www.npmjs.org/package/azure-storage) or Github (https://github.com/Azure/azure-storage-node).
We are pleased to announce that we have released preview version 0.4.0 of our C++ library, which now compiles for both Windows and Linux. 0.4.0 also contains new features including blob download auto-resume functionality and control over the internal buffer size used in the HTTP layer, so we recommend that everyone using an older version upgrades.
Compiling from source is supported for both Windows and Linux; the source code is available through GitHub (https://github.com/Azure/azure-storage-cpp). Binaries for Windows are also available through NuGet (http://www.nuget.org/packages/wastorage/).
Getting Started on Linux
The Azure Storage Client Library for C++ depends on Casablanca. Follow these instructions to compile it. Version 0.4.0 of the library depends on Casablanca version 2.3.0.
Once this is complete, then:
- Clone the project using Git:
The project is cloned to a folder called
azure-storage-cpp. Always use the master branch, which contains the latest release.
- Install additional dependencies:
- Build the SDK for Release:
In the above command, replace
<path to Casablanca> to point to your local installation of Casablanca. For example, if the file
libcpprest.so exists at location
~/Github/Casablanca/casablanca/Release/build.release/Binaries/libcpprest.so, then your
cmake command should be:
The library is generated under
Once you have built the library, the samples should work equally well for Windows and Linux. If you like, you can build the samples as well:
To run the samples:
The getting-started samples in this blog post are also helpful: http://blogs.msdn.com/b/windowsazurestorage/archive/2013/12/20/windows-azure-storage-client-library-for-cplusplus-preview.aspx
Differences between Windows and Linux Client Libraries
The only major difference is in logging. On Windows, we use ETW logging directly. On Linux, we use Boost logging, which means that you can plug in your own sinks as you see fit. Each operation_context has a boost::log::sources::severity_logger<boost::log::trivial::severity_level>; if you want fine-grained control over logging feel free to set your own logger objects. Note that in addition to what Boost provides, we have an internal log_level that we use. Each operation_context gets a log_level that you can set. The default value is set by client_log_level operation_context::default_log_level, which you can also set to turn logging on or off for the library as a whole. The default is that logging is off entirely.
We’re excited about supporting Linux-based usage of Azure Storage from Java, Node.js, and C++. We encourage you to try it out and let us know where we can improve by leaving feedback on GIthub or on this blog. We’ll be working to bring these all to general availability.
Adam Sorrin and Jeff Irwin
Microsoft Azure Storage Team