Skip to content

Latest commit

 

History

History
128 lines (96 loc) · 5.38 KB

README.md

File metadata and controls

128 lines (96 loc) · 5.38 KB

Azure Storage Client Library for 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.

Features

  • Tables
    • Create/Delete Tables
    • Query/Create/Read/Update/Delete Entities
  • Blobs
    • Create/Read/Update/Delete Blobs
  • Queues
    • Create/Delete Queues
    • Insert/Peek Queue Messages
    • Advanced Queue Operations

Please check details on API reference documents.

Getting started

For the best development experience, we recommend that developers use the official Microsoft NuGet packages for libraries. NuGet packages are regularly updated with new functionality and hotfixes. Download the NuGet Package.

Requirements

To call Azure services, you must first have an Azure subscription. Sign up for a free trial or use your MSDN subscriber benefits.

Need Help?

Be sure to check out the Azure Storage Forum on MSDN if you need help, or use StackOverflow.

Collaborate & Contribute

We gladly accept community contributions.

For general suggestions about Azure, use our Azure feedback forum.

Download & Install

Via Git

To create a local clone of the source for the Azure Storage Client Library for C++ via git, type:

git clone https://github.com/Azure/azure-storage-cpp.git
cd azure-storage-cpp

Via NuGet

To install the binaries for the Azure Storage Client Library for C++, type the following into the NuGet Package Manager console:

Install-Package wastorage

Dependencies

C++ REST SDK

The Azure Storage Client Library for C++ depends on the C++ REST SDK (codename "Casablanca") 2.4.0. It can be installed through NuGet or downloaded directly from CodePlex.

Code Samples

How-to topics focused around accomplishing specific tasks are available in the samples folder.

Getting Started on Linux

As mentioned above, the Azure Storage Client Library for C++ depends on Casablanca. Follow these instructions to compile it. Current version of the library depends on Casablanca version 2.4.0.

Once this is complete, then:

  • Clone the project using git:
git clone https://github.com/Azure/azure-storage-cpp.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:
sudo apt-get install libxml++2.6-dev libxml++2.6-doc uuid-dev
  • Build the SDK for Release:
cd azure-storage-cpp/Microsoft.WIndowsAzure.Storage
mkdir build.release
cd build.release
CASABLANCA_DIR=<path to Casablanca> CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Release
make

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:

CASABLANCA_DIR=~/Github/Casablanca/casablanca CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Release

The library is generated under azure-storage-cpp/Microsoft.WindowsAzure.Storage/build.release/Binaries/.

To build and run unit tests:

  • Install UnitTest++ library:
sudo apt-get install libunittest++-dev
  • Build the test code:
CASABLANCA_DIR=<path to Casablanca> CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS
make
  • Run unit tests
cd Binaries
vi test_configurations.json # modify test config file to include your storage account credentials
./azurestoragetest

To build sample code:

CASABLANCA_DIR=<path to Casablanca> CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES
make

To run the samples:

cd Binaries
./samplesblobs            # run the blobs sample
./samplesjson             # run the tables sample with JSON payload
./samplestables           # run the tables sample
./samplesqueues           # run the queues sample

Please note the current build script is only tested on Ubuntu 14.04. Please update the script accordingly for other distributions.