Go to file
Larry Osterman f12d835137
Update feature/websockets to match main. (#3767)
* Support BaseName overrides in CI mode for New-TestResources.ps1 (#3559)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Do not pass Generated to -BaseName (#3562)

Co-authored-by: Heath Stewart <heaths@microsoft.com>

* Sort by service name first (#3570)

Co-authored-by: sima-zhu <sizhu@microsoft.com>

* Initialize the suppression file. (#3569)

* Sync eng/common directory with azure-sdk-tools for PR 3169 (#3572)

* Use the batch version of ValidateDocsMsPackagesFn

* Use proper pipelining for GetPackageInfoJson function

Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>

* [Tech Docs] Libcurl transport adapter (#3484)

* libcurl transport adapter

* updates

* Update LibcurlTransportAdapter.md

* Update LibcurlTransportAdapter.md

* Update doc/LibcurlTransportAdapter.md

Co-authored-by: Jeffrey Richter <jeffrichter@live.com>

Co-authored-by: Jeffrey Richter <jeffrichter@live.com>

* Skip azcopy download if it already exists (#3576)

Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>

* Pin openssl to 1.1.1n (#3575)

* Pin openssl to 1.1.1n

* Updated vcpkg commit to one containing OpenSSL 1.1.1n

* Fixed version number in vcpkg.json

* Fix typo (#3583)

* update curl transport options to support ignore proxy from system (#3564)

* update curl transport options to support ignore proxy from system

* update changelog

* bug fix for cl

* update log level from Retry policy (#3586)

* update log level

* Update sdk/core/azure-core/CHANGELOG.md

Co-authored-by: Ahson Khan <ahkha@microsoft.com>

Co-authored-by: Ahson Khan <ahkha@microsoft.com>

* Add batch protocol layer (#3580)

* Add batch protocol layer

* some small fixes on Storage cmakefiles (#3588)

* Migrate to matrix generator (#3553)

* Represent existing matrix in json
* Use new matrix
* Move to stage
* Cloud configuration
* MaxParallel
* DependsOn
* Quote CtestRegex
* Use template for cmake generate tests
* Template name mappings
* Formatting, parameters
* Remove duplicate bypass-local-dns.yml
* Enable Location override
* Add Location
* Add spelling words
* Use Ubuntu 20 where the name specifies Ubuntu 20
* Apply suggestions from code review

Co-authored-by: Ben Broderick Phillips <ben@benbp.net>

* PR feedback
* fix storage sample
* Matrix documentation

Co-authored-by: Ben Broderick Phillips <ben@benbp.net>
Co-authored-by: Victor Vazquez <vhvb1989@gmail.com>

* Sync eng/common directory with azure-sdk-tools for PR 3212 (#3587)

* bump consumed version of test proxy. update scripting to target the fully cross-platform image tag name.
* update target version of the test-proxy to one that enforces http/1.1

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>

* Sync eng/common directory with azure-sdk-tools for PR 3238 (#3590)

* pin proxy version to one that properly sets listenoptions
* update targeted test-proxy docker repo. "testproxy" -> "test-proxy"

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>

* Sync eng/common directory with azure-sdk-tools for PR 3221 (#3591)

* Make docs.ms link relative link

* Update Update-DocsMsMetadata.ps1

* Update eng/common/scripts/Update-DocsMsMetadata.ps1

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

Co-authored-by: sima-zhu <sizhu@microsoft.com>
Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>
Co-authored-by: Daniel Jurek <djurek@microsoft.com>

* Remove the daily branch before date (#3593)

Co-authored-by: sima-zhu <sizhu@microsoft.com>

* Add ClientCertificateCredential (#3578)

* Add ClientCertificateCredential

* Update unit test

* cspell

* Update Readme

* Cosmetic fixes

* Changelog to mention env cred update

* Fix warning

* cspell

* Tell CI to install openssl

* openssl for all Windows

* update dependency manifest

* Re-phrase changelog

* Clang warnings

* Clang warning

* Clang warning - 2

* Ubuntu18 warning

* Update sdk/identity/azure-identity/CHANGELOG.md

Co-authored-by: Victor Vazquez <victor.vazquez@microsoft.com>

* PR feedback

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
Co-authored-by: Victor Vazquez <victor.vazquez@microsoft.com>

* Sync eng/common directory with azure-sdk-tools for PR 3250 (#3595)

* Change the direction of the commit date

* Log on right place

* remove auth

* fix typo

* Add auth token back

* add delete back

* Update eng/common/scripts/Delete-RemoteBranches.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Update Delete-RemoteBranches.ps1

* Update Delete-RemoteBranches.ps1

* Update Delete-RemoteBranches.ps1

* Update Delete-RemoteBranches.ps1

* Update Delete-RemoteBranches.ps1

Co-authored-by: sima-zhu <sizhu@microsoft.com>
Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Create a session handle once in the transport ctor and reuse it for all requests rather than creating a new one each time. (#3585)

* Reuse the same session handle for all requests rather than creating a new one each time.

* Move the session handle creation to the transport adapter ctor.

* Update changelog entry.

* Address PR feedback.

* Change CreateSessionHandle to return a local session handle

* Fix-up the changelog entry link for the curtransportoption bug fix (#3598)

* Remove extra period at ends of exception messages in winhttp transport (#3601)

* fix cmake in storage (#3604)

* Reword the curl proxy fix changelog entry. (#3606)

* Add Emma Zhu as code owner (#3605)

* Short circuit out of msdocs publish if no package locations are specified (#3607)

Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>

* sdk/core: Reimplement Md5OpenSSL using EVP API (#3609)

The MD5_Init/Update/Final functions are deprecated in OpenSSL 3.0 and result in
a compile-time warning. Due to the default usage of -Werror during compilation,
these warnings are treated as errors and prevent the SDK from being built on
Ubuntu 22.04, which ships with OpenSSL by default. The deprecated APIs should
be replaced by the EVP APIs, which are already in use for the SHA family of
functions, and supported on all versions of OpenSSL.

* API Review Feedback for Attestation SDK (#3543)

* API Review Feedback for Attestation SDK

* Updated changelog to reflect API Review updates

* Remove version pin for OpenSSL (#3610)

* Remove version pin for OpenSSL

* Gratuitous change to trigger CI pipelines

* Update the version tool to the latest (#3616)

Co-authored-by: sima-zhu <sizhu@microsoft.com>

* Get rid of warnings in nullable.hpp (#3617)

* cl (#3613)

* Update pipeline-generator version (#3623)

Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>

* Prepare Attestation SDK for May Release. (#3625)

* Prepare attestation for May release

* Removed some noise from changelog

* Increment package version after release of azure-core (#3624)

* Update CODEOWNERS (#3628)

* Fix identity samples running in CI (#3632)

* azure identity may 2022 release (#3615)

* Increment package version after release of azure-identity (#3637)

* Removed uwp-x86 from platform matrix. (#3629)

* Increment package version after release of azure-security-attestation (#3636)

* Update readme for -pre and -post TestResource scripts (#3645)

Co-authored-by: Christopher Scott <chriss@microsoft.com>

* Fixed a bug where text of XML element cannot be empty. (#3643)

* String parsing improvements to service directory resource names (#3644)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Adding Acknowledgments (#3611)

* cl

* Update sdk/core/azure-core/CHANGELOG.md

Co-authored-by: Ahson Khan <ahkha@microsoft.com>

* cspell

Co-authored-by: Ahson Khan <ahkha@microsoft.com>

* Add skip variable for remove test resources to support debugging (#3648)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Storage Blob Stg78 Features (#3650)

* Clean up target_include_directories() (#3641)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Update all-inclusive headers, and CMakeFiles for including all headers (#3640)

* Remove (#3657)

oexcept specifier from Context::IsCancelled()

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Add Language product slug (#3665)

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>

* Sync eng/common directory with azure-sdk-tools for PR 3342 (#3664)

* Delete PR and branch which central PR is closed

* more logging changes

* resume the delete operations.

* Change the pr link directly

* fix the regex

* Refactor on regex name

* change the function to inline logic

* change typo

* delete on branch

* make changes on comments

* add commnets

* Update eng/common/scripts/Delete-RemoteBranches.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Update eng/common/scripts/Delete-RemoteBranches.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Update eng/common/scripts/Delete-RemoteBranches.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Update eng/common/scripts/Delete-RemoteBranches.ps1

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

Co-authored-by: sima-zhu <sizhu@microsoft.com>
Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Split out attestation client factory into separate class (#3654)

* Split out attestation client factory into separate class

* Updated readme; clang-format

* Final set of API review changes

* Replaced () constructors with {} constructors

* Initial implementation of OpenTelemetry APIs. (#3561)

* Start of tracing prototype

* Created initial implementation of azure-core-opentelemetry package

* New version of enabling MSVCRT Lib for static configs

* Attempt to add OpenTelemetry tests to build

* Take a dependency on OpenTelemetry version 1.3

* Added service API level tracing support

* API Review feedback

* storage unittest fix and improvement (#3667)

* Sync eng/common directory with azure-sdk-tools for PR 3362 (#3676)

* spell-check skippable by commit

* suceededOrFailed -> succeededOrFailed

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>

* Sync eng/common directory with azure-sdk-tools for PR 3378 (#3679)

* Create json package property parent directory

* Fix the issue in script

Co-authored-by: praveenkuttappan <prmarott@microsoft.com>

* Vcpkg sample (#3670)

* one commit to rule them all

* main merge

* error

* all smoke

* typo

* 120 minutes

* timeout param missing on job

* actual url

* Update samples/integration/vcpkg-all-smoke/src/main.cpp

Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com>

* actual creds

Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com>

* Complete the initial implementation of OpenTelemetry (#3677)

* Added telemetry support for HTTP pipeline elements

* Finish OpenTelemetry implementation

* clang-format and added doxygen comments

* Creadscan skips (#3671)

* one commit to rule them all

* main merge

* error

* add recordings for cred scan skipping

* certificates added

* remove dupe

* cspell

* Moved attestation factory back to static method on attestation class … (#3682)

* Moved attestation factory back to static method on attestation class and return a concrete type not a pointer

* Fixed factory in readme file

* OpenTelemetry API Review Feedback (#3687)

* OpenTelemetry API Review Feedback

* Attestation 1.0.0 GA Release (#3693)

* Prepare attestation for release

* removed references to RetrieveResponseValidationCollateral from docs

* Added C++ SDK team as owners of attestation SDK

* Added Ahmad from attestation team to attestation owners

* Removed dead API; switched attestation back to beta-3

* Disable detached head warnings on sparse checkout to commit (#3680)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Remove samples with docker.io (#3621)

* remove samples using docker.io

* removing docker files

* remove project

* Fix issue where matrix replace was not using imported display names (#3694)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Additional OpenTelemetry Feedback... (#3691)

* OpenTelemetry API Review Feedback

* Returns std::unique_ptr<DiagnosticTracingFactory instead of raw pointer

* Late breaking pull request feedback

* Renamed clientContext parameter to CreateSpan

* Renamed ContextAndSpanFactory to TracingContextFactory and CreateSpan to CreateTracingContext.

* Added ability to create instance with pointer (#3698)

* Added ability to create instance with pointer

* Pull request feedback

* Core 1.7.0-beta.1 Release (#3684)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Increment package version after release of azure-core (#3699)

* Format vcpkg.json (#3701)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Update README to list all the vcpkgs (#3704)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Removed version>= fields for openssl in vcpkg.json files (#3705)

* Tab vcpkg publishing condition in to apply to the task (#3709)

* Storage June Release (#3686)

* Override live test location default to westus (#3696)

* Changelog updates for secrets and certificates (#3714)

* Changelog updates for secrets and certificates

* Update package versions

* Removed empty sections in changelog (#3718)

* Identity 1.3.0 Release (#3685)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* OpenTelemetry vcpkg fixes (#3716)

* OpenTelemetry vcpkg fixes

* Update ci.yml

* Drop version >= from project-level vcpkg

* find_package only supports numeric versions

* include(AzureBuildTargetForCI)

* Do not build as Windows/UWP DLL

* Docs and package dependencies

* Update condition

* Move condition down

* Move more under condition

* Rephrase condition

* Try hack for CI that won't affect vcpkg

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Increment package version after release of azure-identity (#3721)

* Increment version for storage releases (#3713)

* Increment package version after release of azure-storage-common

* Increment package version after release of azure-storage-blobs

* [EngSys] Get Vcpkg automatically (#3614)

* get vcpkg automatically

* Updated changelog (#3726)

* Increment package version after release of azure-core-tracing-opentelemetry (#3727)

* Increment package version after release of azure-security-attestation (#3717)

* Increment package version after release of azure-security-attestation (#3720)

* Enable Distributed Tracing for Attestation SDK client. (#3706)

* Implement tracing for Attestation and Template services

* Pipeline no longer requires service name if opting into distributed tracing; enable tracing in attestation service

* Generate user-agent header from request activity policy

* Added test to catch the redacted header regression

* Updated documentation to reflect API surface changes

* Make sample service an object library (#3728)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Include pi-version to default list of unredacted query params for logging (#3730)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Sync eng/common directory with azure-sdk-tools for PR 3433 (#3731)

* add condition

* divide line

Co-authored-by: Mariana Rios Flores <mariari@microsoft.com>

* Sync eng/common directory with azure-sdk-tools for PR 3267 (#3655)

* Use seperate scripts

* address comments.

* do compare and update

* save on the service level readme

* have the helper for reuse function

* remove mgmt table

* changes

* fix

* no return on error

* return if no contents

* Address comments

* change the table

* address wes comments.

* address wes comments.

* address more comments.

Co-authored-by: sima-zhu <sizhu@microsoft.com>

* Sync eng/common directory with azure-sdk-tools for PR 3386 (#3733)

* Update the order of remarks and examples to align with docs.ms

* change all occurance

* Update class.tmpl.partial

Co-authored-by: sizhu <sizhu@microsoft.com>
Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>

* ensure conditions all work properly in the case of a previous error (#3732)

Co-authored-by: Scott Beddall <scbedd@microsoft.com>

* InputSanitizer: rename to HttpSanitizer, remove static member (#3736)

* InputSanitizer => HttpSanitizer, remove static

* Update cpp

* Clang format

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Increment version for keyvault releases (#3719)

* Increment package version after release of azure-security-keyvault-certificates

* Increment package version after release of azure-security-keyvault-secrets

* Update DistributedTracing.md (#3715)

Fix typo

* ApiView command line generation script (#3711)

* ApiView command line generation script

* Strongly typed parameters

Co-authored-by: Ben Broderick Phillips <ben@benbp.net>

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
Co-authored-by: Ben Broderick Phillips <ben@benbp.net>

* Add missing license header to http_sanitizer source file (#3739)

* Add ResourceType parameter - Selects live test or perf test resources (#3740)

Co-authored-by: Mike Harder <mharder@microsoft.com>

* Update identity codeowners (#3744)

* ManagedIdentityCredential: Add support for AppServiceV2019 (#3734)

* ManagedIdentityCredential: Add support for AppServiceV2019

* Attempt to create 2019 before 2017

* Changelog update

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Fix Bug in Resource Ref Verifier (#3758)

Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com>

* Use westus as default region in test resource deployments (#3759)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Perf test for certs (#3729)

* one commit to rule them all

* main merge

* error

* main merge

* error

* main merge

* error

* main merge

* error

* example of perf test

* remove file

* create certs and keys in post setup, use to run the test

* PR comments

* Revert "Override live test location default to westus (#3696)" (#3761)

This reverts commit d4192609d5.

* Sync eng/common directory with azure-sdk-tools for PR 3481 (#3764)

* Support local addons path override in stress test deployment

* Support username based deployId in local stress deployment

* Support WhatIf in stress infrastructure provision script

* Simplify stress user detection

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Run helm plugin add with helper

* Add WhatIf support to ps module install helper function

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Fixed typo in LibcurlTransportAdapter.md (#3768)

Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com>
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
Co-authored-by: Heath Stewart <heaths@microsoft.com>
Co-authored-by: sima-zhu <sizhu@microsoft.com>
Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>
Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>
Co-authored-by: Victor Vazquez <victor.vazquez@microsoft.com>
Co-authored-by: Jeffrey Richter <jeffrichter@live.com>
Co-authored-by: Rick Winter <rick.winter@microsoft.com>
Co-authored-by: Ahson Khan <ahkha@microsoft.com>
Co-authored-by: JinmingHu <jinmhu@microsoft.com>
Co-authored-by: Daniel Jurek <djurek@microsoft.com>
Co-authored-by: Ben Broderick Phillips <ben@benbp.net>
Co-authored-by: Victor Vazquez <vhvb1989@gmail.com>
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
Co-authored-by: Ahson Khan <ahson_ahmedk@yahoo.com>
Co-authored-by: Jeremi Piotrowski <jeremi.piotrowski@gmail.com>
Co-authored-by: Christopher Scott <chriss@microsoft.com>
Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
Co-authored-by: praveenkuttappan <prmarott@microsoft.com>
Co-authored-by: George Arama <50641385+gearama@users.noreply.github.com>
Co-authored-by: Mariana Rios Flores <mariari@microsoft.com>
Co-authored-by: Scott Beddall <scbedd@microsoft.com>
Co-authored-by: Mike Harder <mharder@microsoft.com>
Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com>
2022-06-27 12:28:44 -07:00
.github Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00
.vscode Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00
cmake-modules Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00
doc Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00
eng Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00
samples Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00
sdk Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00
.clang-format Retry policy (#241) 2020-07-10 00:23:40 -07:00
.gitignore Prototype build from source (#3180) 2022-01-14 13:06:00 -08:00
CMakeLists.txt Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00
CMakeSettings.json Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-01-10 15:45:21 -08:00
CONTRIBUTING.md Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00
LICENSE.txt update main root license to be txt (#888) 2020-11-04 17:03:15 +00:00
README.md Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00
SECURITY.md Replaced relative link with absolute links and remove locale (#668) 2020-09-17 22:28:36 -07:00
vcpkg.json Update feature/websockets to match main. (#3767) 2022-06-27 12:28:44 -07:00

Azure SDK for C++

Build Status

This repository is for active development of the Azure SDK for C++. For consumers of the SDK we recommend visiting our developer docs.

Getting started

For the best development experience, we recommend developers use CMake projects in Visual Studio to view and build the source code together with its dependencies. You can also use any other text editor of your choice, such as VS Code, along with the command line for building your application with the SDK.

You can find additional information for specific libraries by navigating to the appropriate folder in the /sdk directory. See the README.md file located in the library's project folder, for example, the Azure Storage client library.

For API reference docs, tutorials, samples, quick starts, and other documentation, go to Azure SDK for C++ Developer Docs.

Download & Install the SDK

Here are some alternatives, from easiest to advanced, how you can get, build and integrate Azure SDK clients to your application.

CMake Project + Vcpkg - manifest mode

The easiest way to acquire the C++ SDK is leveraging vcpkg package manager. You will need to install Git before getting started.

1. Create a CMake project

CMake will take care of cross-operating system support.

Visual Studio installs CMake without adding it to the path. You need to install CMake if you are not using Visual Studio or if you want to use a command line outside Visual Studio.

Visual Studio:

If you are using Visual Studio and you installed support for CMake, you can create a new CMake Project from Visual Studio, new project menu.

-IMAGE HERE Visual Studio-

Visual Studio Code:

Install the VSCode extensions: CMake and CMake Tools. Then, create folder for your project and open it with VSCode. Press F1 and type CMake: Quick Start, follow the steps to give a name to your project, to select a compiler and any other initial configuration.

-IMAGE HERE VSCode-

You can also manually create the root CMakeLists.txt with your own initial configuration and source.

Azure SDK provides a CMake module that you can use for your application. You only need to create a folder called cmake-modules on the top level of your CMake project and copy AzureVcpkg.cmake to this folder.

The AzureVcpkg module supports three scenarios:

  1. Getting and setting up Vcpkg automatically (default case). You can set the env var AZURE_SDK_DISABLE_AUTO_VCPKG to disable this bahavior.
  2. Automatically linking your application to an existing Vcpkg folder. Set the environment variable VCPKG_ROOT to the Vcpkg folder you want to link.
  3. Manually setting a toolchain file with cmake command option. AzureVcpkg.cmake module will respect the option.

Add the next lines to your root CMakeLists.txt to use AzureVcpkg.cmake module:

# Add this lines on the top, before the call to `project(name VERSION 0.0.0)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules")
include(AzureVcpkg)
az_vcpkg_integrate()
3. Add Vcpkg manifest

Add a new file called vcpkg.json on the root of your CMake project and add the Azure SDK clients you want to use in your application. For example, the next manifest defines Azure Identity and Blobs.

{
    "name": "your-app-name",
    "version-string": "<Your app version like 1.0.0>", 
    "dependencies": [
        "azure-identity-cpp",
        "azure-storage-blobs-cpp"
    ]
}

Add the next lines to your CMakeLists.txt file. It must be added after the cmake target name is defined.

find_package(azure-identity-cpp CONFIG REQUIRED)
find_package(azure-storage-blobs-cpp CONFIG REQUIRED)
target_link_libraries(quick-sample PRIVATE Azure::azure-identity Azure::azure-storage-blobs)

See the list of available SDK clients for C++ here

5. Generate project and compile

At this point, you can press F7 on Visual Studio or VSCode to generate and build the project. Or you can also run the following commands from a command line:

# Create a build folder (if there's not one already there)
mkdir build
cd build
cmake ..
cmake --build .

Using Vcpkg manifest makes easy to define multiple dependencies and delegate building them to Vcpkg.

CMake Project + fetch content

For this scenario, CMake will fetch the Azure SDK source code and make it part of your project. THe SDK client libraries will be compiled at the same time as your application.

Follow the step 1 from above to create a CMake project first.

2. Define CMake fetch content

Add the following code to your root CMakeLists.txt file:

# Add this code before creating and linking your application

include(FetchContent)
FetchContent_Declare(
    azuresdk
    GIT_REPOSITORY      https://github.com/Azure/azure-sdk-for-cpp.git
    GIT_TAG             <Release Tag or Git-Commit-Here>
)
FetchContent_GetProperties(azuresdk)
if(NOT azuresdk_POPULATED)
    FetchContent_Populate(azuresdk)
    # Adding all Azure SDK libraries
    add_subdirectory(${azuresdk_SOURCE_DIR} ${azuresdk_BINARY_DIR} EXCLUDE_FROM_ALL)
    # Adding one Azure SDK Library only (Storage blobs)
    # add_subdirectory(${azuresdk_SOURCE_DIR}/sdk/storage/azure-storage-blobs ${azuresdk_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

The only difference from the previous scenario is that you don't need to call find_package(), since the cmake targets are integrated to your project. So you only need:

# After creating the cmake target
target_link_libraries(quick-sample PRIVATE Azure::azure-identity Azure::azure-storage-blobs)

Note: You need to take care of getting the Azure SDK dependencies on your own. Either manually installing them or by integrating the source code to your project as well.

Use step 5 from previous scenario to generate and build your project.

This scenario requires extra manual configuration to get dependencies, but it is useful as an alternative when Vcpkg is not available

Other combinations

It should be possible to create your application without a CMake project. For example, manually cloning Azure SDK, building libraries and finally linking them to your application. However, this is considered an advanced scenario and it is not either described or maintained (The other scenarios described below are validated with CI pipelines).

Getting Beta Releases in Vcpkg

Official vcpkg registry may have beta versions of Azure SDK client libraries, up until a given library gets released as stable. After that, we don't publish post-first-stable beta releases of that library in the official registry.

If you are interested in both stable releases and post-first-stable beta releases, see Azure SDK Beta Vcpkg Registry. You can update the AzureVcpkg.cmake module to use the beta registry.

Using the SDK within your Application

The entry point for most scenarios when using the SDK will be a top-level client type corresponding to the Azure service. For example, sending requests to blob storage can be done via the Azure::Storage::Blobs::BlobClient API. All APIs on the client type send HTTP requests to the cloud service and return back an HTTP Response<T>.

Azure C++ SDK headers needed are located within the <azure> folder, with sub-folders corresponding to each service. Similarly, all types and APIs can be found within the Azure:: namespace. For example, to use functionality from Azure::Core, include the following header at the beginning of your application #include <azure/core.hpp>.

Here's an example application to help you get started:

#include <iostream>

// Include the necessary SDK headers
#include <azure/core.hpp>
#include <azure/storage/blobs.hpp>

// Add appropriate using namespace directives
using namespace Azure::Storage;
using namespace Azure::Storage::Blobs;

// Secrets should be stored & retrieved from secure locations such as Azure::KeyVault. For
// convenience and brevity of samples, the secrets are retrieved from environment variables.
std::string GetEndpointUrl() { return std::getenv("AZURE_STORAGE_ACCOUNT_URL"); }
std::string GetAccountName() { return std::getenv("AZURE_STORAGE_ACCOUNT_NAME"); }
std::string GetAccountKey() { return std::getenv("AZURE_STORAGE_ACCOUNT_KEY"); }

int main()
{
  std::string endpointUrl = GetEndpointUrl();
  std::string accountName = GetAccountName();
  std::string accountKey = GetAccountKey();

  try
  {
    auto sharedKeyCredential = std::make_shared<StorageSharedKeyCredential>(accountName, accountKey);

    auto blockBlobClient = BlockBlobClient(endpointUrl, sharedKeyCredential);

    // Create some data to upload into the blob.
    std::vector<uint8_t> data = {1, 2, 3, 4};
    Azure::Core::IO::MemoryBodyStream stream(data);

    Azure::Response<Models::UploadBlockBlobResult> response = blockBlobClient.Upload(stream);

    Models::UploadBlockBlobResult model = response.Value;
    std::cout << "Last modified date of uploaded blob: " << model.LastModified.ToString()
              << std::endl;
  }
  catch (const Azure::Core::RequestFailedException& e)
  {
    std::cout << "Status Code: " << static_cast<int>(e.StatusCode)
              << ", Reason Phrase: " << e.ReasonPhrase << std::endl;
    std::cout << e.what() << std::endl;
    return 1;
  }
  return 0;
}

Key Core concepts

Understanding the key concepts from the Azure Core library, which is leveraged by all client libraries is helpful in getting started, regardless of which Azure service you want to use.

The main shared concepts of Azure Core include:

  • Accessing HTTP response details for the returned model of any SDK client operation, via Response<T>.
  • Exceptions for reporting errors from service requests in a consistent fashion via the base exception type RequestFailedException.
  • Abstractions for Azure SDK credentials (TokenCredential).
  • Handling streaming data and input/output (I/O) via BodyStream along with its derived types.
  • Polling long-running operations (LROs), via Operation<T>.
  • Collections are returned via PagedResponse<T>.
  • HTTP pipeline and HTTP policies such as retry and logging, which are configurable via service client specific options.
  • Replaceable HTTP transport layer to send requests and receive responses over the network.

Response <T> Model Types

Many client library operations return the templated Azure::Core::Response<T> type from the API calls. This type let's you get the raw HTTP response from the service request call the Azure service APIs make, along with the result of the operation to get more API specific details. This is the templated T operation result which can be extracted from the response, using the Value field.

  // Azure service operations return a Response<T> templated type.
  Azure::Response<Models::BlobProperties> propertiesResponse = blockBlobClient.GetProperties();

  // You can get the T, from the returned Response<T>,
  // which is typically named with a Result suffix in the type name.
  Models::BlobProperties propertiesModel = propertiesResponse.Value;

  // Now you can look at API specific members on the result object that is returned.
  std::cout << "The size of the blob is: " << propertiesModel.BlobSize << std::endl;

Long Running Operations

Some operations take a long time to complete and require polling for their status. Methods starting long-running operations return Operation<T> types.

You can intermittently poll whether the operation has finished by using the Poll() method inside a loop on the returned Operation<T> and track progress of the operation using Value(), while the operation is not done (using IsDone()). Your per-polling custom logic can go in that loop, such as logging progress.Alternatively, if you just want to wait until the operation completes, you can use PollUntilDone().

  std::string sourceUri = "<a uri to the source blob to copy>";

  // Typically, long running operation APIs have names that begin with Start.
  StartBlobCopyOperation operation = blockBlobClient.StartCopyFromUri(sourceUri);

  // Waits for the operation to finish, checking for status every 1 second.
  auto copyResponse = operation.PollUntilDone(std::chrono::milliseconds(1000));
  auto propertiesModel = copyResponse.Value;

  // Now you can look at API specific members on the result object that is returned.
  if (propertiesModel.CopySource.HasValue())
  {
    std::cout << "The source of the copied blob is: " << propertiesModel.CopySource.Value()
              << std::endl;
  }

Interacting with Azure SDK for C++

Static SDK members should not be accessed and SDK functions should not be called before the static initialization phase is finished.

Visual Studio - CMakeSettings.json

When building your application via Visual Studio, you can create and update a CMakeSettings.json file and include the following properties to let Visual Studio know where the packages are installed and which triplet needs to be used:

{
  "configurations": [
    {
        "cmakeToolchain": "<path to vcpkg repo>/vcpkg/scripts/buildsystems/vcpkg.cmake",
        "variables": [
        {
          "name": "VCPKG_TARGET_TRIPLET",
          "value": "x64-windows",
          "type": "STRING"
        }
      ]
    }
  ]
}

Azure Requirements

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

Packages available

Each service might have a number of libraries available. These libraries follow the Azure SDK Design Guidelines for C++ and share a number of core features such as HTTP retries, logging, transport protocols, authentication protocols, etc., so that once you learn how to use these features in one client library, you will know how to use them in other client libraries. You can learn about these shared features at Azure::Core.

The client libraries can be identified by the naming used for their folder, package, and namespace. Each will start with azure, followed by the service category, and then the name of the service. For example azure-storage-blobs.

For a complete list of available packages, please see the latest available packages page.

NOTE: If you need to ensure your code is ready for production we strongly recommend using one of the stable, non-beta libraries.

Vcpkg

The following SDK library releases are available on vcpkg:

  • azure-core-cpp
  • azure-identity-cpp
  • azure-security-attestation-cpp
  • azure-security-keyvault-certificates-cpp
  • azure-security-keyvault-keys-cpp
  • azure-security-keyvault-secrets-cpp
  • azure-storage-blobs-cpp
  • azure-storage-files-datalake-cpp
  • azure-storage-files-shares-cpp
  • azure-storage-queues-cpp

NOTE: In case of getting linker errors when consuming the SDK on Windows, make sure that vcpkg triplet being consumed matches the CRT link flags being set for your app or library build. See also MSVC_USE_STATIC_CRT build flag.

Need help

Navigating the repository

Main branch

The main branch has the most recent code with new features and bug fixes. It does not represent latest released beta or GA SDK.

Release branches (Release tagging)

For each package we release there will be a unique Git tag created that contains the name and the version of the package to mark the commit of the code that produced the package. This tag will be used for servicing via hotfix branches as well as debugging the code for a particular beta or stable release version. Format of the release tags are <package-name>_<package-version>. For more information please see our branching strategy.

Contributing

For details on contributing to this repository, see the contributing guide.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, view Microsoft's CLA.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Many people all over the world have helped make this project better. You'll want to check out:

Reporting security issues and security bugs

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

License

Azure SDK for C++ is licensed under the MIT license.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Impressions