Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files

Initial version

  • Loading branch information...
pablo cibraro
pablo cibraro committed Aug 17, 2016
1 parent 11c3b2b commit 53a45db54a3d662aacd43ced58a4d3983d3c2d80
Showing with 3,369 additions and 9 deletions.
  1. +62 −9
  2. +28 −0 storage-blob-cpp-getting-started.sln
  3. +60 −0 storage-blob-cpp-getting-started/CMakeLists.txt
  4. BIN storage-blob-cpp-getting-started/HelloWorld.png
  5. +710 −0 storage-blob-cpp-getting-started/blob_advanced.cpp
  6. +39 −0 storage-blob-cpp-getting-started/blob_advanced.h
  7. +230 −0 storage-blob-cpp-getting-started/blob_basic.cpp
  8. +31 −0 storage-blob-cpp-getting-started/blob_basic.h
  9. +48 −0 storage-blob-cpp-getting-started/cmake/Modules/FindAzureStorage.cmake
  10. +47 −0 storage-blob-cpp-getting-started/cmake/Modules/FindCasablanca.cmake
  11. +37 −0 storage-blob-cpp-getting-started/cmake/Modules/FindGlib.cmake
  12. +54 −0 storage-blob-cpp-getting-started/cmake/Modules/FindGlibmm.cmake
  13. +58 −0 storage-blob-cpp-getting-started/cmake/Modules/FindLibXML++.cmake
  14. +44 −0 storage-blob-cpp-getting-started/cmake/Modules/FindLibXML2.cmake
  15. +35 −0 storage-blob-cpp-getting-started/cmake/Modules/FindSigC++.cmake
  16. +108 −0 storage-blob-cpp-getting-started/cmake/Modules/FindUUID.cmake
  17. +34 −0 storage-blob-cpp-getting-started/cmake/Modules/FindUnitTest++.cmake
  18. +266 −0 storage-blob-cpp-getting-started/cmake/Modules/LibFindMacros.cmake
  19. +8 −0 storage-blob-cpp-getting-started/packages.config
  20. +302 −0 storage-blob-cpp-getting-started/queue_advanced.cpp
  21. +32 −0 storage-blob-cpp-getting-started/queue_advanced.h
  22. +203 −0 storage-blob-cpp-getting-started/queue_basic.cpp
  23. +28 −0 storage-blob-cpp-getting-started/queue_basic.h
  24. +23 −0 storage-blob-cpp-getting-started/stdafx.cpp
  25. +37 −0 storage-blob-cpp-getting-started/stdafx.h
  26. +184 −0 storage-blob-cpp-getting-started/storage-blob-cpp-getting-started.vcxproj
  27. +106 −0 storage-blob-cpp-getting-started/storage-getting-started.cpp
  28. +32 −0 storage-blob-cpp-getting-started/string_util.cpp
  29. +23 −0 storage-blob-cpp-getting-started/string_util.h
  30. +219 −0 storage-blob-cpp-getting-started/table_advanced.cpp
  31. +30 −0 storage-blob-cpp-getting-started/table_advanced.h
  32. +223 −0 storage-blob-cpp-getting-started/table_basic.cpp
  33. +28 −0 storage-blob-cpp-getting-started/table_basic.h
@@ -1,10 +1,63 @@
# storage-blob-cpp-getting-started
The getting started sample demonstrates how to perform common tasks using the Azure Blob Service in C++ including uploading a blob, CRUD operations, listing, as well as blob snapshot creation.
## Running this sample
Coming soon...
## Deploy this sample to Azure
Coming soon...
## About the code
Coming soon...
services: storage
platforms: cpp
author: pcibraro

# Azure Storage Service Samples in C++

Demonstrates how to use the Blob Service.

- Azure Blob storage is a service that stores unstructured data in the cloud as objects/blobs. Blob storage can store any type of text or binary data, such as documents, media files or application installers. Blob storage is also refered to as object storage. This sample demostrates how to perform common tasks for managing containers and blobs with data.

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](

## Running this sample in Windows

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):

1. Download and Install the Azure Storage Emulator [here](
2. Start the Azure Storage Emulator (once only) by pressing the Start button or the Windows key and searching for it by typing "Azure Storage Emulator". Select it from the list of applications to start it.
3. Set breakpoints and run the project using F10.

To run the sample using the Storage Service

1. Open the storage-getting-started.cpp file and find the variable storage_connection_string. Replace the value (UseDevelopmentStorage=True) with the connection string for the storage service (AccountName=[]...)
2. Create a Storage Account through the Azure Portal and provide your [AccountName] and [AccountKey] in the storage_connection_string variable.
3. Set breakpoints and run the project using F10.

## Running this sample in Linux

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,

- Clone the project using git:
git clone
The project is cloned to a folder called `storage-blob-cpp-getting-started`. Always use the master branch, which contains the latest release.

- Build the samples:
cd storage-blob-cpp-getting-started/storage-blob-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
In 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 `` exists at location `~/Github/Casablanca/cpprestsdk/Release/build.release/Binaries/` and the file `` exists at location `~/Github/azure-storage-cpp/Microsoft.WindowsAzure.Storage/build.release/Binaries/`, then your `cmake` command should be:
CASABLANCA_DIR=~/Github/Casablanca/cpprestsdk AZURESTORAGE_DIR=~/Github/azure-storage-cpp CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Release
The sample is generated under `storage-blob-cpp-getting-started/storage-blob-cpp-getting-started/build/Binaries/`.

## More information
Coming soon...
- [What is a Storage Account](
- [How to use Blob Storage from C++](
- [Blob Service Concepts](
- [Blob Service REST API](
- [Storage Emulator](
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "storage-blob-cpp-getting-started", "storage-blob-cpp-getting-started\storage-blob-cpp-getting-started.vcxproj", "{E7DA1623-2B9F-4B43-BE01-5FCD5F539C51}"
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E7DA1623-2B9F-4B43-BE01-5FCD5F539C51}.Debug|x64.ActiveCfg = Debug|x64
{E7DA1623-2B9F-4B43-BE01-5FCD5F539C51}.Debug|x64.Build.0 = Debug|x64
{E7DA1623-2B9F-4B43-BE01-5FCD5F539C51}.Debug|x86.ActiveCfg = Debug|Win32
{E7DA1623-2B9F-4B43-BE01-5FCD5F539C51}.Debug|x86.Build.0 = Debug|Win32
{E7DA1623-2B9F-4B43-BE01-5FCD5F539C51}.Release|x64.ActiveCfg = Release|x64
{E7DA1623-2B9F-4B43-BE01-5FCD5F539C51}.Release|x64.Build.0 = Release|x64
{E7DA1623-2B9F-4B43-BE01-5FCD5F539C51}.Release|x86.ActiveCfg = Release|Win32
{E7DA1623-2B9F-4B43-BE01-5FCD5F539C51}.Release|x86.Build.0 = Release|Win32
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -0,0 +1,60 @@
cmake_minimum_required(VERSION 2.6)



# Platform (not compiler) specific settings
find_package(Boost REQUIRED COMPONENTS log log_setup random system thread locale regex filesystem chrono date_time)
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Glibmm REQUIRED)
find_package(LibXML++ REQUIRED)
find_package(UUID REQUIRED)
find_package(Casablanca REQUIRED)
find_package(AzureStorage REQUIRED)
message("-- Unsupported Build Platform.")

# Compiler (not platform) specific settings
message("-- Setting gcc options")

set(WARNINGS "-Wall -Wextra -Wunused-parameter -Wcast-align -Wcast-qual -Wconversion -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-format-attribute -Wmissing-include-dirs -Wpacked -Wredundant-decls -Wunreachable-code")
set(LINUX_SUPPRESSIONS "-Wno-deprecated -Wno-unknown-pragmas -Wno-reorder -Wno-unused-function -Wno-char-subscripts -Wno-switch -Wno-unused-but-set-parameter -Wno-unused-value -Wno-unused-local-typedefs -Wno-unused-parameter")

set(LD_FLAGS "${LD_FLAGS} -Wl,-z,defs")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing")

set(STRICT_CXX_FLAGS ${WARNINGS} "-Werror -pedantic")

message("-- Unknown compiler, success is doubtful.")

# Reconfigure final output directory




add_executable(azurestoragesamples storage-getting-started.cpp
target_link_libraries(azurestoragesamples ${AZURESTORAGESAMPLES_LIBRARIES})

Binary file not shown.

0 comments on commit 53a45db

Please sign in to comment.
You can’t perform that action at this time.