Microsoft Azure Storage Client Library for C++
7.5.0
The Microsoft Azure Storage Client Library for C++ is a library for working with the Azure Storage Services in C++.
|
The Azure Storage Client Library for C++ allows you to build applications against Microsoft Azure Storage. For an overview of Azure Storage, see Introduction to Microsoft Azure Storage.
There is an alternative client library that requires minimum dependency, which provides basic object storage that Blob service offers. Please see azure-storage-cpplite for more information.
For the best development experience, we recommend that developers use the vcpkg as the cross-platform library manager.
To call Azure services, you must first have an Azure subscription. Sign up for a free trial or use your MSDN subscriber benefits.
Be sure to check out the Azure Storage Forum on MSDN if you need help, or use StackOverflow.
We gladly accept community contributions.
For general suggestions about Azure, use our Azure feedback forum.
To build with source code, there are three ways to install dependencies:
Via vcpkg
You can manage the dependencies with vcpkg, and use Visual Studio 2015 update 3 or Visual Studio 2017 for development environment. Simply installing Casablanca via vcpkg will setup everything needed. ```BatchFile C:\src\vcpkg> .\vcpkg install cpprestsdk ```
If you want to build and run test code, you can install UnitTest++ via vcpkg: ```BatchFile C:\src\vcpkg> .\vcpkg install unittest-cpp ```
Via NuGet
Because Casablanca does not release NuGet packages anywhere anymore, Starting from 5.1.0, this repository cannot be built with pre-built Casablanca NuGet packages. However, you can export your own version of Casablanca NuGet packages to install dependencies of this project: ```BatchFile C:\src\vcpkg> .\vcpkg install cpprestsdk C:\src\vcpkg> .\vcpkg export –nuget cpprestsdk –nuget-id=Casablanca –nuget-version=2.10.16 ```
Manage dependencies by yourself
It is not recommended to manage dependencies by yourself. However, you can still build Casablanca by yourself by following these instructions and specify the include directories and link binaries.
To create a local clone of the source for the Azure Storage Client Library for C++ via git, type:
Follow Getting Started on Linux or Getting Started on macOS to build on these two platforms.
To build on Windows, directly open the solution file with Visual Studio in project root directory.
Starting from version 6.1.0, Azure Storage Client Library for C++ supports Visual Studio 2015 and Visual Studio 2017. In case you have the need to use Visual Studio 2013, please get version 6.0.0, to use Visual Studio 2012, please get version 2.0.0.
To install the binaries for the Azure Storage Client Library for C++, you can export a NuGet package with vcpkg and put it into your local NuGet feed. For more information about how to export a NuGet package, please see Binary Export.
Normally, exporting NuGet package is done with the following command:
To install the Azure Storage Client Library for C++ through vcpkg, you need vcpkg installed first. Please follow the instructions(https://github.com/Microsoft/vcpkg#quick-start) to install vcpkg.
Install package with:
The Azure Storage Client Library for C++ depends on the C++ REST SDK (codename "Casablanca") It can be installed through vcpkg (vcpkg install cpprestsdk
) or downloaded directly from GitHub.
The validated Casablanca version for each major or recent release on different platforms can be found in the following chart:
azure-storage-cpp's version | Casablanca version for Windows | Casablanca version for Linux |
---|---|---|
1.0.0 | 2.4.0 | 2.4.0 |
2.0.0 | 2.4.0 | 2.4.0 |
3.0.0 | 2.9.1 | 2.9.1 |
4.0.0 | 2.9.1 | 2.9.1 |
5.0.0 | 2.9.1 | 2.9.1 |
5.0.1 | 2.9.1 | 2.9.1 |
5.1.0 | 2.10.6 | 2.10.3 |
5.1.1 | 2.10.6 | 2.10.3 |
5.2.0 | 2.10.6 | 2.10.3 |
6.0.0 | 2.10.10 | 2.10.10 |
6.1.0 | 2.10.13 | 2.10.13 |
7.0.0 | 2.10.14 | 2.10.14 |
7.1.0 | 2.10.14 | 2.10.14 |
7.2.0 | 2.10.14 | 2.10.14 |
7.3.0 | 2.10.15 | 2.10.15 |
7.3.1 | 2.10.15 | 2.10.15 |
7.4.0 | 2.10.16 | 2.10.16 |
7.5.0 | 2.10.16 | 2.10.16 |
To get started with the coding, please visit the following articles:
To accomplish specific tasks, please find the code samples at samples folder.
As mentioned above, the Azure Storage Client Library for C++ depends on Casablanca. Follow these instructions to compile it.
Once this is complete, then:
azure-storage-cpp
. Always use the master branch, which contains the latest release.<path to Casablanca>
to point to your local installation of Casablanca. For example, if the file libcpprest.so
exists at location ~/Github/Casablanca/cpprestsdk/Release/build.release/Binaries/libcpprest.so
, then your cmake
command should be: azure-storage-cpp/Microsoft.WindowsAzure.Storage/build.release/Binaries/
.To build and run unit tests:
To build sample code:
To run the samples:
Please note the current build script is only tested on Ubuntu 16.04. Please update the script accordingly for other distributions.
Please note that starting from 2.10.0, Casablanca requires a minimum version of CMake v3.1, so the default CMake on Ubuntu 14.04 cannot support Casablanca build. User can upgrade CMake by themselves to build Casablanca. If default CMake (2.8) for Ubuntu 14.04 must be used, 5.0.1 with Casablanca version v2.9.1 is recommended.
Please note the following build script is only tested on SLES12 SP3. The script may need to be updated accordingly for other distributions.
Before building the Azure Storage Client Library on C++, some prerequisites need to be installed first:
The Azure Storage Client Library for C++ depends on Casablanca, following are instructions to build and install Casablanca:
To build the Azure Storage Client Library for C++ project:
azure-storage-cpp
. Always use the master branch, which contains the latest release.The library is generated under azure-storage-cpp/Microsoft.WindowsAzure.Storage/build.release/Binaries/
.
The Azure Storage Client Library for C++ project depends on Unitest++ for unit test:
To build and install Unitest++:
Build and run unit test against Azure Storage Client Library for C++:
To build sample code:
To run the samples:
Please note the following build script is only tested on CentOS 6.10 and 7.6. The script may need to be updated accordingly for other distributions.
Before building the Azure Storage Client Library on C++, some prerequisites need to be installed first:
devtoolset-4
may be not available on some platforms, you can choose to install whichever newer than that, like devtoolset-8
. The Azure Storage Client Library for C++ depends on Casablanca, following are instructions to build and install Casablanca:
To build the Azure Storage Client Library for C++ project:
azure-storage-cpp
. Always use the master branch, which contains the latest release.The library is generated under azure-storage-cpp/Microsoft.WindowsAzure.Storage/build.release/Binaries/
.
The Azure Storage Client Library for C++ project depends on Unitest++ for unit test:
To build and install Unitest++:
Build and run unit test against Azure Storage Client Library for C++:
Note that macOS is not officially supported yet, but it has been seen to work, YMMV. This build has been tested to work when the dependencies are installed via homebrew, YMMV if using FINK or MacPorts
Install dependecies with homebrew:
As mentioned above, the Azure Storage Client Library for C++ depends on Casablanca. If you are using homebrew you can install it from there:
Otherwise, you may need to build it. Follow these instructions to compile it.
Once this is complete, then:
azure-storage-cpp
. Always use the master branch, which contains the latest release.Some notes about building:
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/cpprestsdk/Release/build.release/Binaries/libcpprest.dylib
, then <path to="" casablanca>=""> should be ~/Github/Casablanca/cpprestsdk
<path to openssl>
to your local openssl, it is recommended not to use the version that comes with macOS, rather use one from Homebrew or the like. This should be the path that contains the lib
and include
directories<path to gettext lib dir>
is the directory which contains libintl.dylib
For example you might use:
The library is generated under azure-storage-cpp/Microsoft.WindowsAzure.Storage/build.release/Binaries/
.
To build and run unit tests: