azure-sdk-for-cpp/sdk/storage
Victor Vazquez 835f156af9
Vcpkg manifest and binary caching (#3329)
* binary cache and manifest

* update packages

* udpate

* add cache to private pipeline

* next try

* aver

* other

* again

* aver quick

* more

* this way

* again

* one more

* print

* test

* use depend

* more deps

* dep

* Apply suggestions from code review

Co-authored-by: Daniel Jurek <djurek@microsoft.com>

* updated to use group variable

* update identity

* end line

* Update vcpkg.json

* Apply suggestions from code review

* cspell

* remove comment

* updates

* make cache mode depend on SAS env var

* map env var only for internal pipelines

* other approach

* what about this

* and this

* try

* amd

* another

* extra step

* typo

* override for internal

* use default succeded

* azure core update manifest

* a

* run cmake-generate nightly as well

* check for SAS

* check cache

* no secret

* fix is secret

* pass explicit

* use secret all the time

* char

* One more

* export

* echos

* last

* array

* remove question

* ok

* weird

* use account key

* substring

* VCPKG_BINARY_SOURCES

* Add module installation

* task:

* Correct pathing for module

* update source gen

* format

* update spelling

* IsWindoows

* Use pwsh

* Cannot clobber with PSModule-Helpers. Attempt plain install

* Attempt plain install

* Revert unnecessary change to Update-DocsMsToc.ps1

* template ready

* curl is required on Windows as well for some CI gates

* attestation

* fix format

Co-authored-by: Daniel Jurek <djurek@microsoft.com>
2022-03-24 09:11:30 -07:00
..
azure-storage-blobs Vcpkg manifest and binary caching (#3329) 2022-03-24 09:11:30 -07:00
azure-storage-common Vcpkg manifest and binary caching (#3329) 2022-03-24 09:11:30 -07:00
azure-storage-files-datalake Vcpkg manifest and binary caching (#3329) 2022-03-24 09:11:30 -07:00
azure-storage-files-shares Vcpkg manifest and binary caching (#3329) 2022-03-24 09:11:30 -07:00
azure-storage-queues Vcpkg manifest and binary caching (#3329) 2022-03-24 09:11:30 -07:00
ci.yml Recordings for storage (#3194) 2022-01-18 14:50:15 -08:00
CMakeLists.txt Build ci gates per service (#3260) 2022-01-20 18:09:06 +00:00
MigrationGuide.md Update migration guide, add sample for wraping sync into async (#3469) 2022-03-24 11:16:24 +08:00
README.md restructure storage samples (#3113) 2021-11-19 09:59:34 +08:00
test-resources-post.ps1
test-resources.json Update release mode windows + samples (#3451) 2022-03-22 01:39:39 +00:00

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

  • Blobs
    • Create/Delete/List Containers
    • Create/Read/Update/Delete/List Blobs
  • DataLake Gen 2
    • Create/Delete File Systems
    • Create/Delete Directories
    • Create/Read/Append/Flush/Delete Files
  • File Shares
    • Create/Delete Shares
    • Create/Delete Directories
    • Create/Read/Delete Files

Getting started

For the best development experience, we recommend that developers use the CMake projects in Visual Studio to view and build the source code together with its dependencies.

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

Install Dependencies

Windows

On Windows, dependencies are managed by vcpkg. You can reference the Quick Start to quickly set yourself up. After Vcpkg is initialized and bootstrapped, you can install the dependencies:

vcpkg.exe install curl:x64-windows-static

POSIX Platforms

You can use the package manager on different POSIX platforms to install the dependencies. The dependencies to be installed are:

  • CMake 3.13.0 or higher.
  • libxml2.
  • OpenSSL.
  • libcurl.

Build from Source

First, download the repository to your local folder:

git clone https://github.com/Azure/azure-sdk-for-cpp.git

Windows

Use CMake to generate the solution file

In a new folder you created under the root directory:

cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<YOUR_VCPKG_INSTALL_DIR>/scripts/buildsystems/vcpkg.cmake
cmake --build .

The built library will be in .\sdk\<ProjectDir>\<Configuration>\ respectively for Azure Core and Azure Storage. e.g. azure_core.lib will be in .\sdk\core\azure-core\Debug for debug configuration.

Use Visual Studio's Open by folder feature

Open the root folder of the library with Visual Studio's Open folder feature.

If Vcpkg is not globally integrated, then you need to open CMakeSettings.json and change the Make toolchain file to be <YOUR_VCPKG_INSTALL_DIR>/scripts/buildsystems/vcpkg.cmake and save. Then you can build Azure Storage libraries by selecting the target in Visual Studio, or simply build all. The libraries will be in <ProjectRoot>\out\build\<Configuration>\sdk\<LibraryName> respectively.

POSIX Platforms

You can run the following command in a new folder created under the downloaded code's root folder to build the code.

cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake --build .

Then you can consume the built library with the header files. make/ninja install is work in progress.

Via NuGet

WIP TODO when ready.

Via vcpkg

The easiest way to acquire the C++ SDK is leveraging vcpkg package manager. See the corresponding Azure SDK for C++ readme section.

To install Azure Storage packages via vcpkg:

> vcpkg install azure-storage-blobs-cpp azure-storage-files-datalake-cpp azure-storage-files-shares-cpp

Then, use in your CMake file:

find_package(azure-storage-blobs-cpp CONFIG REQUIRED)
target_link_libraries(<your project name> PRIVATE Azure::azure-storage-blobs)

find_package(azure-storage-files-datalake-cpp CONFIG REQUIRED)
target_link_libraries(<your project name> PRIVATE Azure::azure-storage-files-datalake)

find_package(azure-storage-files-shares-cpp CONFIG REQUIRED)
target_link_libraries(<your project name> PRIVATE Azure::azure-storage-files-shares)

Dependencies

Code Samples

To get started with the coding, please visit the following code samples: