{"id":15291108,"url":"https://github.com/azure/azure-sdk-for-cpp","last_synced_at":"2026-04-03T00:33:17.305Z","repository":{"id":36957535,"uuid":"233147271","full_name":"Azure/azure-sdk-for-cpp","owner":"Azure","description":"This repository is for active development of the Azure SDK for C++.  For consumers of the SDK we recommend visiting our versioned developer docs at https://azure.github.io/azure-sdk-for-cpp. ","archived":false,"fork":false,"pushed_at":"2025-04-14T21:26:36.000Z","size":24439,"stargazers_count":182,"open_issues_count":269,"forks_count":132,"subscribers_count":333,"default_branch":"main","last_synced_at":"2025-04-14T22:31:23.180Z","etag":null,"topics":["azure","azure-sdk","cpp","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Azure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-01-10T23:29:08.000Z","updated_at":"2025-04-14T21:26:38.000Z","dependencies_parsed_at":"2023-09-28T04:11:01.478Z","dependency_job_id":"b45fca26-a3eb-4b30-acbf-974815f0e0c1","html_url":"https://github.com/Azure/azure-sdk-for-cpp","commit_stats":{"total_commits":2840,"total_committers":61,"mean_commits":"46.557377049180324","dds":0.7059859154929577,"last_synced_commit":"47bf038701cd9488695e7fc5e15819fe689a79c6"},"previous_names":[],"tags_count":356,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fazure-sdk-for-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fazure-sdk-for-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fazure-sdk-for-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fazure-sdk-for-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure","download_url":"https://codeload.github.com/Azure/azure-sdk-for-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249003944,"owners_count":21196794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-sdk","cpp","hacktoberfest"],"created_at":"2024-09-30T16:10:59.636Z","updated_at":"2026-01-18T01:42:36.479Z","avatar_url":"https://github.com/Azure.png","language":"C++","readme":"# Azure SDK for C++\n\n[![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/cpp/cpp%20-%20client%20-%20ci?branchName=main)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=1611\u0026branchName=main)\n\u003ca href=\"https://www.surveymonkey.com/r/gh-badge\"\u003e\u003cimg src=\"https://img.shields.io/badge/Take%20Our%20Design%20Discussion%20Survey-008000\"/\u003e\u003c/a\u003e\n\nThis repository is for active development of the Azure SDK for C++. For consumers of the SDK we recommend visiting our [developer docs](https://azure.github.io/azure-sdk-for-cpp).\n\n## Getting started\n\nThe Azure SDK for C++ is compatible with a number of different development environments and tools. The following instructions will utilize [Visual Studio](https://visualstudio.microsoft.com/) or [VSCode](https://code.visualstudio.com/) as the IDE, [CMake](https://cmake.org/) for build automation, and [vcpkg](https://vcpkg.io/) as our package manager.\n\n### Prerequisites\n\n- An Azure subscription. Sign up for a [free trial](https://azure.microsoft.com/pricing/free-trial/) or use your [MSDN subscriber benefits](https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/).\n- [A C++ compiler](https://code.visualstudio.com/docs/languages/cpp#_install-a-compiler).\n\n### Development environment and tools set up\n\n- [Visual Studio, CMake and vcpkg](https://learn.microsoft.com/vcpkg/get_started/get-started-vs/)\n- [VS Code, CMake and vcpkg](https://learn.microsoft.com/vcpkg/get_started/get-started-vscode/)\n\n### Install libraries\n\n- Open a terminal\n  - **Visual Studio:** Open the Developer Command Prompt: **Tools \u003e Commandline \u003e Developer Command Prompt**\n  - **VSCode:** Open a new Terminal in VSCode: **Terminal \u003e New Terminal**\n- Add the `azure-identity-cpp` and `azure-storage-blobs-cpp` libraries with the following command:\n\n```console\nvcpkg add port azure-identity-cpp azure-storage-blobs-cpp\n```\n\n- Your `vcpkg.json` should now contain:\n\n```json\n{\n    \"dependencies\": [\n        \"azure-identity-cpp\",\n        \"azure-storage-blobs-cpp\"\n    ]\n}\n```\n\n### Configure CMake project files\n\n- Replace the contents of `CMakeLists.txt` with the following:\n\n```cmake\ncmake_minimum_required(VERSION 3.10)\n\nproject(HelloWorld)\n\nfind_package(azure-identity-cpp CONFIG REQUIRED)\nfind_package(azure-storage-blobs-cpp CONFIG REQUIRED)\n\nadd_executable(HelloWorld helloworld.cpp)\n\ntarget_link_libraries(HelloWorld PRIVATE Azure::azure-identity Azure::azure-storage-blobs)\n```\n\n### Installing Azure SDK packages in a Visual Studio MSBuild (.vcxproj) project\n\nHere's a walkthrough video on how to install the Azure SDK packages, using vcpkg, into an MSBuild project in VS: https://aka.ms/azsdk/cpp/gettingstarted-vcpkg-msbuild-video\n\nSee the [vcpkg documentation](https://learn.microsoft.com/vcpkg/get_started/get-started-msbuild?pivots=shell-cmd) for more details.\n\n### Additional methods for installing and configuring\n\n\u003c!-- Commenting out for now until we know if something similar already exists or if we have to create it. --\u003e\n\u003c!-- - [Get started by cloning a sample project]() --\u003e\n- [CMake project and fetch content](https://github.com/Azure/azure-sdk-for-cpp/tree/main/samples/integration/cmake-fetch-content/)\n- [How to use beta packages](https://github.com/Azure/azure-sdk-for-cpp/tree/main/samples/integration/beta-packages-vcpkg/)\n\n### Using the SDK within your application\n\nThe **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\u003cT\u003e`.\n\nAzure C++ SDK headers needed are located within the `\u003cazure\u003e` 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 \u003cazure/core.hpp\u003e`.\n\nHere's an example application to help you get started:\n\n```cpp\n#include \u003ciostream\u003e\n\n// Include the necessary SDK headers\n#include \u003cazure/core.hpp\u003e\n#include \u003cazure/storage/blobs.hpp\u003e\n\n// Add appropriate using namespace directives\nusing namespace Azure::Storage;\nusing namespace Azure::Storage::Blobs;\n\n// Secrets should be stored \u0026 retrieved from secure locations such as Azure::KeyVault. For\n// convenience and brevity of samples, the secrets are retrieved from environment variables.\nstd::string GetEndpointUrl() { return std::getenv(\"AZURE_STORAGE_ACCOUNT_URL\"); }\nstd::string GetAccountName() { return std::getenv(\"AZURE_STORAGE_ACCOUNT_NAME\"); }\nstd::string GetAccountKey() { return std::getenv(\"AZURE_STORAGE_ACCOUNT_KEY\"); }\n\nint main()\n{\n  std::string endpointUrl = GetEndpointUrl();\n  std::string accountName = GetAccountName();\n  std::string accountKey = GetAccountKey();\n\n  try\n  {\n    auto sharedKeyCredential = std::make_shared\u003cStorageSharedKeyCredential\u003e(accountName, accountKey);\n\n    auto blockBlobClient = BlockBlobClient(endpointUrl, sharedKeyCredential);\n\n    // Create some data to upload into the blob.\n    std::vector\u003cuint8_t\u003e data = {1, 2, 3, 4};\n    Azure::Core::IO::MemoryBodyStream stream(data);\n\n    Azure::Response\u003cModels::UploadBlockBlobResult\u003e response = blockBlobClient.Upload(stream);\n\n    Models::UploadBlockBlobResult model = response.Value;\n    std::cout \u003c\u003c \"Last modified date of uploaded blob: \" \u003c\u003c model.LastModified.ToString()\n              \u003c\u003c std::endl;\n  }\n  catch (const Azure::Core::RequestFailedException\u0026 e)\n  {\n    std::cout \u003c\u003c \"Status Code: \" \u003c\u003c static_cast\u003cint\u003e(e.StatusCode)\n              \u003c\u003c \", Reason Phrase: \" \u003c\u003c e.ReasonPhrase \u003c\u003c std::endl;\n    std::cout \u003c\u003c e.what() \u003c\u003c std::endl;\n    return 1;\n  }\n  return 0;\n}\n```\n\n### Build and run the project\n\n- **Visual Studio:** Press `Ctrl+Shift+B` to build the project in Visual Studio. Then click the run play button.\n- **VSCode:** Open the Command Palette with `Ctrl+Shift+P` and run the `CMake: Build` command. Select the `default` CMake preset. Then launch the project.\n\n## Key Core concepts\n\nUnderstanding 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.\n\nThe main shared concepts of `Azure Core` include:\n\n- Accessing HTTP response details for the returned model of any SDK client operation, via `Response\u003cT\u003e`.\n- Exceptions for reporting errors from service requests in a consistent fashion via the base exception type `RequestFailedException`.\n- Abstractions for Azure SDK credentials (`TokenCredential`).\n- Handling streaming data and input/output (I/O) via `BodyStream` along with its derived types.\n- Polling long-running operations (LROs), via `Operation\u003cT\u003e`.\n- Collections are returned via `PagedResponse\u003cT\u003e`.\n- HTTP pipeline and HTTP policies such as retry and logging, which are configurable via service client specific options.\n- Replaceable HTTP transport layer to send requests and receive responses over the network.\n\n#### `Response \u003cT\u003e` Model Types\n\nMany client library operations **return** the templated `Azure::Core::Response\u003cT\u003e` 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.\n\n```cpp\n  // Azure service operations return a Response\u003cT\u003e templated type.\n  Azure::Response\u003cModels::BlobProperties\u003e propertiesResponse = blockBlobClient.GetProperties();\n\n  // You can get the T, from the returned Response\u003cT\u003e,\n  // which is typically named with a Result suffix in the type name.\n  Models::BlobProperties propertiesModel = propertiesResponse.Value;\n\n  // Now you can look at API specific members on the result object that is returned.\n  std::cout \u003c\u003c \"The size of the blob is: \" \u003c\u003c propertiesModel.BlobSize \u003c\u003c std::endl;\n```\n\n#### Long Running Operations\n\nSome operations take a long time to complete and require polling for their status. Methods starting long-running operations return `Operation\u003cT\u003e` types.\n\nYou can intermittently poll whether the operation has finished by using the `Poll()` method inside a loop on the returned `Operation\u003cT\u003e` 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()`.\n\n```cpp\n  std::string sourceUri = \"\u003ca uri to the source blob to copy\u003e\";\n\n  // Typically, long running operation APIs have names that begin with Start.\n  StartBlobCopyOperation operation = blockBlobClient.StartCopyFromUri(sourceUri);\n\n  // Waits for the operation to finish, checking for status every 1 second.\n  auto copyResponse = operation.PollUntilDone(std::chrono::milliseconds(1000));\n  auto propertiesModel = copyResponse.Value;\n\n  // Now you can look at API specific members on the result object that is returned.\n  if (propertiesModel.CopySource.HasValue())\n  {\n    std::cout \u003c\u003c \"The source of the copied blob is: \" \u003c\u003c propertiesModel.CopySource.Value()\n              \u003c\u003c std::endl;\n  }\n```\n\n#### `Azure::Core::Context`\n\nMost Azure SDK Service Client methods accept an optional `Azure::Core::Context` parameter, which is used to enable cancellation of the operation or to\nestablish an absolute deadline for the operation.\n\nThis is useful when you want to assign a time limit on an operation to ensure that it completes in a \"reasonable\" timeframe. For instance, the \nsnippet below will cancel a blob client upload after 5 seconds.\n\n\u003c!-- @insert_snippet: CreateBlobContext --\u003e\n```cpp\n      Azure::Core::Context cancelledIn5s{\n          std::chrono::system_clock::now() + std::chrono::seconds(5)};\n\n      auto containerClient = BlobContainerClient::CreateFromConnectionString(\n          GetConnectionString(), containerName + std::to_string(i));\n      containerClient.CreateIfNotExists({}, cancelledIn5s);\n      for (int j = 0; j \u003c 3; ++j)\n      {\n        BlockBlobClient blobClient\n            = containerClient.GetBlockBlobClient(blobName + std::to_string(j));\n        blobClient.UploadFrom(\n            reinterpret_cast\u003cconst uint8_t*\u003e(blobContent.data()),\n            blobContent.size(),\n            {},\n            cancelledIn5s);\n      }\n```\n\n`Context` objects can also be directly cancelled using the `Cancel()` method.\n\n`Context` objects form a directed tree, where a child context can be created from a parent context. \nThe context tree is unidirectional and acyclic.\n\nThese are the basic operations that can be performed on a `Context` object:\n\n* Create a child context from a parent context with a Key/Value pair. This is useful for associating metadata with a context.\n* Create a child context from a parent context with a deadline. This is useful for setting a timeout.\n* Cancel a context. This will cancel the context and all its children. Note that there is no way of un-cancelling a context.\n* Check if a context is cancelled.\n\nWhen a context is copied from another context, the copied context will share state with the original context. \nThis means that if the original context is cancelled, the copied context will also be cancelled.\n\nCancellation of a `Context` is a permanent operation. Once a context is cancelled, it cannot be un-cancelled.\n\nWhen a client operation fails with an `Azure::Core::OperationCancelledException`, it is typically due to a `Context` getting cancelled. This exception can be caught and handled by the application.\n\n#### Public, Private, and Internal Types\n\nFor the most part, the APIs defined in the Azure SDK for C++ fall into three categories:\n\n- **Public**: These are the types that are intended to be used by the consumers of the SDK.\nThey are part of the public API and are stable. Breaking changes to these types will be avoided as much\nas possible. All public types and functions are located are in the `Azure` root namespace.\n- **Internal**: These are the types that are used internally by the packages within the SDK.\nThey are intended for use by the packages which make up the Azure SDK. They are NOT intended to be used by the consumers of the SDK.\nBreaking changes to these types are allowed, within certain constraints. These types are located in an `Azure` namespace within the `_internal` terminal namespace (for instance, `Azure::Core::Http::Policies::_internal::RequestActivityPolicy`).\n- **Private**: These are the types that are used internally to individual Azure SDK Packages.\nThey are not intended to be used by the consumers of the SDK, nor by other SDK packages. Breaking changes\nto these types are allowed. These types are located in an `Azure` namespace within the `_detail` terminal namespace.\n\nWithin the source tree, Internal types are typically declared in directories named \"internal\", and Private types are typically declared in directories named \"private\".\n\n#### Interacting with Azure SDK for C++\n\nStatic SDK members should not be accessed and SDK functions should not be called before the static initialization phase is finished.\n\n#### Visual Studio - CMakeSettings.json\n\nWhen 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:\n\n```json\n{\n  \"configurations\": [\n    {\n        \"cmakeToolchain\": \"\u003cpath to vcpkg repo\u003e/vcpkg/scripts/buildsystems/vcpkg.cmake\",\n        \"variables\": [\n        {\n          \"name\": \"VCPKG_TARGET_TRIPLET\",\n          \"value\": \"x64-windows\",\n          \"type\": \"STRING\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n### Azure Requirements\n\nTo call Azure services, you must first have an Azure subscription. Sign up for a [free trial](https://azure.microsoft.com/pricing/free-trial/) or use your [MSDN subscriber benefits](https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/).\n\n## Packages available\n\nEach service might have a number of libraries available. These libraries follow the [Azure SDK Design Guidelines for C++](https://azure.github.io/azure-sdk/cpp_introduction.html) 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](https://github.com/Azure/azure-sdk-for-cpp/blob/main/sdk/core/azure-core/README.md).\n\nThe 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`.\n\nFor a complete list of available packages, please see the [latest available packages](https://azure.github.io/azure-sdk/releases/latest/#c) page.\n\n\u003e NOTE: If you need to ensure your code is ready for production we strongly recommend using one of the stable, non-beta libraries.\n\n### Vcpkg\n\nThe following SDK library releases are available on [vcpkg](https://github.com/microsoft/vcpkg):\n\n- `azure-core-cpp`\n- `azure-identity-cpp`\n- `azure-security-attestation-cpp`\n- `azure-security-keyvault-certificates-cpp`\n- `azure-security-keyvault-keys-cpp`\n- `azure-security-keyvault-secrets-cpp`\n- `azure-storage-blobs-cpp`\n- `azure-storage-files-datalake-cpp`\n- `azure-storage-files-shares-cpp`\n- `azure-storage-queues-cpp`\n\n\u003e NOTE: In case of getting linker errors when consuming the SDK on Windows, make sure that [vcpkg triplet](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/users/triplets.md) being consumed matches the [CRT link flags](https://learn.microsoft.com/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-160) being set for your app or library build. See also `MSVC_USE_STATIC_CRT` build flag.\n\n## OpenSSL Version\n\nSeveral packages within the Azure SDK for C++ use the OpenSSL library. By default, the Azure SDK will use whatever the most recent version of OpenSSL is within the VCPKG repository.\n\n### Using a specific version of OpenSSL\n\nIf you need to use a specific version of OpenSSL, you can use the vcpkg custom ports feature to specify the version of OpenSSL to use.\nFor example, if you want to use OpenSSL 1.1.1, you should create a folder named `vcpkg-custom-ports` next to to your vcpkg.json file.\n\nNavigate to your clone of the vcpkg vcpkg repo and execute \"git checkout 3b3bd424827a1f7f4813216f6b32b6c61e386b2e\" - this will reset your repo to the last version of OpenSSL 1.1.1\nin vcpkg. Then, copy the contents of the `ports/openssl` folder from the vcpkg repo to the `vcpkg-custom-ports` folder you created earlier:\n\n```sh\ncd \u003cyour vcpkg repo\u003e\ngit checkout 3b3bd424827a1f7f4813216f6b32b6c61e386b2e\ncd ports\ncp -r openssl \u003cthe location of the vcpkg-custom-ports directory listed above\u003e\n```\n\nThis will copy the port information for OpenSSL 1.1.1n to your vcpkg-custom-ports directory.\n\nOnce that is done, you can install the custom port of OpenSSL 1.1.1n using the vcpkg tool:\n\n```sh\nvcpkg install --overlay-ports=\u003cpath to the vcpkg-custom-ports above\u003e\n```\n\nIf you are building using CMAKE, you can instruct CMAKE to apply the overlay ports using the following command line switches:\n\n```sh\ncmake -DVCPKG_MANIFEST_MODE=ON -DVCPKG_OVERLAY_PORTS=\u003cpath to the vcpkg-custom-ports above\u003e -DVCPKG_MANIFEST_DIR=\u003cpath to the directory containing the vcpkg.json file\u003e\n```\n\nIn addition, if you need to consume OpenSSL from a dynamic linked library/shared object, you can set the VCPKG triplet to reflect that you want to build the library with dynamic entries. Set the VCPKG_you can set the environment variable to `x64-windows-static` or `x64-windows-dynamic` depending on whether you want to use the static or dynamic version of OpenSSL.\nSimilarly you can use the x64-linux-dynamic and x64-linux-static triplet to specify consumption of libraries as a shared object or dynamic.\n\n### Using the system package manager to install OpenSSL\n\nIf you are using a Linux distribution that uses the system package manager to install libraries, you can use the system package\nmanager to install OpenSSL.\n\nThe vcpkg team has a [feature](https://devblogs.microsoft.com/cppblog/using-system-package-manager-dependencies-with-vcpkg/)\nwhich allows you to use the system package manager to install dependencies.\n\n## Need help\n\n- For reference documentation visit the [Azure SDK for C++ documentation](https://azure.github.io/azure-sdk-for-cpp).\n- For tutorials, samples, quick starts and other documentation, visit [Azure for C++ Developers](https://learn.microsoft.com/azure/).\n- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-cpp/issues/new/choose).\n\n## Navigating the repository\n\n### Main branch\n\nThe main branch has the most recent code with new features and bug fixes. It does **not** represent latest released **beta** or **GA** SDK.\n\n### Release branches (Release tagging)\n\nFor 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.\nFormat of the release tags are `\u003cpackage-name\u003e_\u003cpackage-version\u003e`. For more information please see [our branching strategy](https://github.com/Azure/azure-sdk/blob/main/docs/policies/repobranching.md#release-tagging).\n\n## Contributing\n\nFor details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-cpp/blob/main/CONTRIBUTING.md).\n\nThis 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](https://cla.microsoft.com).\n\nWhen 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.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n### Additional Helpful Links for Contributors\n\nMany people all over the world have helped make this project better.  You'll want to check out:\n\n- [What are some good first issues for new contributors to the repo?](https://github.com/azure/azure-sdk-for-cpp/issues?q=is%3Aopen+is%3Aissue+label%3A%22up+for+grabs%22)\n- [How to build and test your change](https://github.com/Azure/azure-sdk-for-cpp/blob/main/CONTRIBUTING.md#developer-guide)\n- [How you can make a change happen!](https://github.com/Azure/azure-sdk-for-cpp/blob/main/CONTRIBUTING.md#pull-requests)\n- Frequently Asked Questions (FAQ) and Conceptual Topics in the detailed [Azure SDK for C++ wiki](https://github.com/azure/azure-sdk-for-cpp/wiki).\n\n\u003c!-- ### Community--\u003e\n### Reporting security issues and security bugs\n\nSecurity issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) \u003csecure@microsoft.com\u003e. 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](https://www.microsoft.com/msrc/faqs-report-an-issue).\n\n### Data Collection\n\nThe software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described below. You can learn more about data collection and use in the help documentation and Microsoft's [privacy statement](https://go.microsoft.com/fwlink/?LinkID=824704). For more information on the data collected by the Azure SDK, please visit the [Telemetry Guidelines](https://azure.github.io/azure-sdk/general_azurecore.html#telemetry-policy) page.\n\n### Telemetry Configuration\n\nTelemetry collection is on by default.\n\nTo opt out, you can disable telemetry at client construction. Creating a custom HTTP policy in your application gives you access to the headers sent with each request, allowing you to remove the `User-Agent` header containing client telemetry. To use the policy, you will add it to the options for your specific client as part of client creation. This will disable Azure SDK telemetry for all methods in the client. You will need to register the policy with each client created.\n\nAn example policy implementation looks like:\n\n```cpp\nclass RemoveUserAgentPolicy : public HttpPolicy {\nprivate:\n  std::unique_ptr\u003cRawResponse\u003e Send(\n      Request\u0026 request,\n      NextHttpPolicy nextPolicy,\n      Context const\u0026 context) const override\n  {\n    // Set your own User-Agent header or set an empty one to suppress telemetry\n    request.SetHeader(\"User-Agent\", \"\");\n    \n    return nextPolicy.Send(request, context);\n  }\n\n  std::unique_ptr\u003cHttpPolicy\u003e Clone() const override { return std::make_unique\u003cRemoveUserAgentPolicy\u003e(*this); }\n};\n```\n\nTo use it with a client, you would register it to run for every operation as part of your client options:\n\n```cpp\nUri serviceEndpoint = \"\u003chttps://example.storage.windows.net\u003e\";\nstd::shared_ptr\u003cCore::Credentials::TokenCredential\u003e credential = \n    std::make_shared\u003cIdentity::DefaultAzureCredential\u003e();\n           \nBlobClientOptions clientOptions;\nclientOptions.PerOperationPolicies.emplace_back(std::make_unique\u003cRemoveUserAgentPolicy\u003e());\n\nBlobServiceClient client(serviceEndpoint, credential, clientOptions);\n```\n\nYou can also customize the telemetry information by setting an application identifier, which will be prepended to the User-Agent header:\n\n```cpp\n// Add application ID to client options for telemetry\nBlobClientOptions clientOptions;\nclientOptions.Telemetry.ApplicationId = \"MyApplication/1.0.0\";\nauto blobServiceClient = BlobServiceClient::CreateFromConnectionString(connectionString, clientOptions);\n```\n\n### License\n\nAzure SDK for C++ is licensed under the [MIT](https://github.com/Azure/azure-sdk-for-cpp/blob/main/LICENSE.txt) license.\n\n### Trademarks\n\nThis 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 \u0026 Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general). 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.\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fazure-sdk-for-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazure%2Fazure-sdk-for-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fazure-sdk-for-cpp/lists"}