Demonstrates how to use the Table Storage Service.
Note: This sample uses the Windows Azure Storage client library for C++ available through a Nuget package, which depends on the Visual Studio version you will use for development. For Visual Studio 2015, use the Nuget package "wastorage.v140". For Visual Studio 2013, use "wastorage.v120".
If you don't have a Microsoft Azure subscription you can get a FREE trial account here.
This sample can be run using either the Azure Storage Emulator that installs as part of the Windows Azure SDK - or by updating the storage_connection_string variable defined at the top of the program.
To run the sample using the Storage Emulator (Windows Azure SDK):
To run the sample using the Storage Service
In order to compile and run this sample in Linux, you first need to get a local copy of the C++ REST SDK (aka Casablanca) from here and the Azure Storage Client Library for C++ from here. Both libraries must be compiled following the instructions described in the corresponding Github repositories. Once you have these libraries, follow these instructions to build the samples,
bash git clone https://github.com/Azure-Samples/storage-table-cpp-getting-started.git
The project is cloned to a folder called
storage-table-cpp-getting-started. Always use the master branch, which contains the latest release.
bash cd storage-table-cpp-getting-started/storage-table-cpp-getting-started mkdir build cd build CASABLANCA_DIR=<path to Casablanca> AZURESTORAGE_DIR=<path to AzureStorage> CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Release makeIn the above command, replace
<path to Casablanca>to point to your local installation of Casablanca and
<path to Casablanca>to point to your local installation of the Azure Storage Client library. For example, if the file
libcpprest.soexists at location
~/Github/Casablanca/cpprestsdk/Release/build.release/Binaries/libcpprest.soand the file
libazurestorage.soexists at location
~/Github/azure-storage-cpp/Microsoft.WindowsAzure.Storage/build.release/Binaries/libazurestorage.so, then your
cmakecommand should be:
bash CASABLANCA_DIR=~/Github/Casablanca/cpprestsdk AZURESTORAGE_DIR=~/Github/azure-storage-cpp CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=ReleaseThe sample is generated under