430 строки
30 KiB
HTML
430 строки
30 KiB
HTML
<!DOCTYPE html>
|
|
<!--[if IE]><![endif]-->
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<title>Azure SDK for C++ | Azure SDK for C++ </title>
|
|
<meta name="viewport" content="width=device-width">
|
|
<meta name="title" content="Azure SDK for C++ | Azure SDK for C++ ">
|
|
<meta name="generator" content="docfx 2.43.2.0">
|
|
|
|
<link rel="shortcut icon" href="https://c.s-microsoft.com/favicon.ico?v2">
|
|
<link rel="stylesheet" href="styles/docfx.vendor.css">
|
|
<link rel="stylesheet" href="styles/docfx.css">
|
|
<link rel="stylesheet" href="styles/main.css">
|
|
<meta property="docfx:navrel" content="navtoc.html">
|
|
<meta property="docfx:tocrel" content="toc.html">
|
|
|
|
|
|
<meta property="docfx:newtab" content="true">
|
|
|
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-62780441-44"></script>
|
|
<script>
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag(){dataLayer.push(arguments);}
|
|
gtag('js', new Date());
|
|
|
|
gtag('config', 'UA-62780441-44');
|
|
</script>
|
|
</head>
|
|
<body data-spy="scroll" data-target="#affix" data-offset="120">
|
|
<div id="wrapper">
|
|
<header>
|
|
|
|
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
|
|
<a class="navbar-brand" href="index.html">
|
|
<img id="logo" class="svg" src="logo.svg" alt="">
|
|
</a>
|
|
</div>
|
|
<div class="collapse navbar-collapse" id="navbar">
|
|
<form class="navbar-form navbar-right" role="search" id="search">
|
|
<div class="form-group">
|
|
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="subnav navbar navbar-default">
|
|
<div class="container hide-when-search" id="breadcrumb">
|
|
<ul class="breadcrumb">
|
|
<li></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div role="main" class="container body-content hide-when-search">
|
|
|
|
<div class="sidenav hide-when-search">
|
|
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
|
|
<div class="sidetoggle collapse" id="sidetoggle">
|
|
<div id="sidetoc"></div>
|
|
</div>
|
|
</div>
|
|
<div class="article row grid-right">
|
|
<div class="col-md-10">
|
|
<article class="content wrap" id="_content" data-uid="">
|
|
<h1 id="azure-sdk-for-c">Azure SDK for C++</h1>
|
|
|
|
<p><a href="https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=1611&branchName=main"><img src="https://dev.azure.com/azure-sdk/public/_apis/build/status/cpp/cpp%20-%20client%20-%20ci?branchName=main" alt="Build Status"></a>
|
|
<a href="https://www.surveymonkey.com/r/gh-badge"><img src="https://img.shields.io/badge/Take%20Our%20Design%20Discussion%20Survey-008000"></a></p>
|
|
<p>This repository is for active development of the Azure SDK for C++. For consumers of the SDK we recommend visiting our <a href="https://azure.github.io/azure-sdk-for-cpp">developer docs</a>.</p>
|
|
<h2 id="getting-started">Getting started</h2>
|
|
<p>The Azure SDK for C++ is compatible with a number of different development environments and tools. The following instructions will utilize <a href="https://visualstudio.microsoft.com/">Visual Studio</a> or <a href="https://code.visualstudio.com/">VSCode</a> as the IDE, <a href="https://cmake.org/">CMake</a> for build automation, and <a href="https://vcpkg.io/">vcpkg</a> as our package manager.</p>
|
|
<h3 id="prerequisites">Prerequisites</h3>
|
|
<ul>
|
|
<li>An Azure subscription. Sign up for a <a href="https://azure.microsoft.com/pricing/free-trial/">free trial</a> or use your <a href="https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/">MSDN subscriber benefits</a>.</li>
|
|
<li><a href="https://code.visualstudio.com/docs/languages/cpp#_install-a-compiler">A C++ compiler</a>.</li>
|
|
</ul>
|
|
<h3 id="development-environment-and-tools-set-up">Development environment and tools set up</h3>
|
|
<ul>
|
|
<li><a href="https://learn.microsoft.com/vcpkg/get_started/get-started-vs/">Visual Studio, CMake and vcpkg</a></li>
|
|
<li><a href="https://learn.microsoft.com/vcpkg/get_started/get-started-vscode/">VS Code, CMake and vcpkg</a></li>
|
|
</ul>
|
|
<h3 id="install-libraries">Install libraries</h3>
|
|
<ul>
|
|
<li>Open a terminal
|
|
<ul>
|
|
<li><strong>Visual Studio:</strong> Open the Developer Command Prompt: <strong>Tools > Commandline > Developer Command Prompt</strong></li>
|
|
<li><strong>VSCode:</strong> Open a new Terminal in VSCode: <strong>Terminal > New Terminal</strong></li>
|
|
</ul>
|
|
</li>
|
|
<li>Add the <code>azure-identity-cpp</code> and <code>azure-storage-blobs-cpp</code> libraries with the following command:</li>
|
|
</ul>
|
|
<pre><code class="lang-console">vcpkg add port azure-identity-cpp azure-storage-blobs-cpp
|
|
</code></pre>
|
|
<ul>
|
|
<li>Your <code>vcpkg.json</code> should now contain:</li>
|
|
</ul>
|
|
<pre><code class="lang-json">{
|
|
"dependencies": [
|
|
"azure-identity-cpp",
|
|
"azure-storage-blobs-cpp"
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h3 id="configure-cmake-project-files">Configure CMake project files</h3>
|
|
<ul>
|
|
<li>Replace the contents of <code>CMakeLists.txt</code> with the following:</li>
|
|
</ul>
|
|
<pre><code class="lang-cmake">cmake_minimum_required(VERSION 3.10)
|
|
|
|
project(HelloWorld)
|
|
|
|
find_package(azure-identity-cpp CONFIG REQUIRED)
|
|
find_package(azure-storage-blobs-cpp CONFIG REQUIRED)
|
|
|
|
add_executable(HelloWorld helloworld.cpp)
|
|
|
|
target_link_libraries(HelloWorld PRIVATE Azure::azure-identity Azure::azure-storage-blobs)
|
|
</code></pre>
|
|
<h3 id="installing-azure-sdk-packages-in-a-visual-studio-msbuild-vcxproj-project">Installing Azure SDK packages in a Visual Studio MSBuild (.vcxproj) project</h3>
|
|
<p>Here's a walkthrough video on how to install the Azure SDK packages, using vcpkg, into an MSBuild project in VS: <a href="https://aka.ms/azsdk/cpp/gettingstarted-vcpkg-msbuild-video">https://aka.ms/azsdk/cpp/gettingstarted-vcpkg-msbuild-video</a></p>
|
|
<p>See the <a href="https://learn.microsoft.com/vcpkg/get_started/get-started-msbuild?pivots=shell-cmd">vcpkg documentation</a> for more details.</p>
|
|
<h3 id="additional-methods-for-installing-and-configuring">Additional methods for installing and configuring</h3>
|
|
<!-- Commenting out for now until we know if something similar already exists or if we have to create it. -->
|
|
<!-- - [Get started by cloning a sample project]() -->
|
|
<ul>
|
|
<li><a href="https://github.com/Azure/azure-sdk-for-cpp/tree/main/samples/integration/cmake-fetch-content/">CMake project and fetch content</a></li>
|
|
<li><a href="https://github.com/Azure/azure-sdk-for-cpp/tree/main/samples/integration/beta-packages-vcpkg/">How to use beta packages</a></li>
|
|
</ul>
|
|
<h3 id="using-the-sdk-within-your-application">Using the SDK within your application</h3>
|
|
<p>The <strong>entry point</strong> 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 <code>Azure::Storage::Blobs::BlobClient</code> API. All APIs on the client type send HTTP requests to the cloud service and return back an HTTP <code>Response<T></code>.</p>
|
|
<p>Azure C++ SDK headers needed are located within the <code><azure></code> folder, with sub-folders corresponding to each service. Similarly, all types and APIs can be found within the <code>Azure::</code> namespace. For example, to use functionality from <code>Azure::Core</code>, include the following header at the beginning of your application <code>#include <azure/core.hpp></code>.</p>
|
|
<p>Here's an example application to help you get started:</p>
|
|
<pre><code class="lang-cpp">#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;
|
|
}
|
|
</code></pre>
|
|
<h3 id="build-and-run-the-project">Build and run the project</h3>
|
|
<ul>
|
|
<li><strong>Visual Studio:</strong> Press <code>Ctrl+Shift+B</code> to build the project in Visual Studio. Then click the run play button.</li>
|
|
<li><strong>VSCode:</strong> Open the Command Palette with <code>Ctrl+Shift+P</code> and run the <code>CMake: Build</code> command. Select the <code>default</code> CMake preset. Then launch the project.</li>
|
|
</ul>
|
|
<h2 id="key-core-concepts">Key Core concepts</h2>
|
|
<p>Understanding the key concepts from the <code>Azure Core</code> library, which is leveraged by all client libraries is helpful in getting started, regardless of which Azure service you want to use.</p>
|
|
<p>The main shared concepts of <code>Azure Core</code> include:</p>
|
|
<ul>
|
|
<li>Accessing HTTP response details for the returned model of any SDK client operation, via <code>Response<T></code>.</li>
|
|
<li>Exceptions for reporting errors from service requests in a consistent fashion via the base exception type <code>RequestFailedException</code>.</li>
|
|
<li>Abstractions for Azure SDK credentials (<code>TokenCredential</code>).</li>
|
|
<li>Handling streaming data and input/output (I/O) via <code>BodyStream</code> along with its derived types.</li>
|
|
<li>Polling long-running operations (LROs), via <code>Operation<T></code>.</li>
|
|
<li>Collections are returned via <code>PagedResponse<T></code>.</li>
|
|
<li>HTTP pipeline and HTTP policies such as retry and logging, which are configurable via service client specific options.</li>
|
|
<li>Replaceable HTTP transport layer to send requests and receive responses over the network.</li>
|
|
</ul>
|
|
<h4 id="response-t-model-types"><code>Response <T></code> Model Types</h4>
|
|
<p>Many client library operations <strong>return</strong> the templated <code>Azure::Core::Response<T></code> 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 <code>T</code> operation result which can be extracted from the response, using the <code>Value</code> field.</p>
|
|
<pre><code class="lang-cpp"> // 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;
|
|
</code></pre>
|
|
<h4 id="long-running-operations">Long Running Operations</h4>
|
|
<p>Some operations take a long time to complete and require polling for their status. Methods starting long-running operations return <code>Operation<T></code> types.</p>
|
|
<p>You can intermittently poll whether the operation has finished by using the <code>Poll()</code> method inside a loop on the returned <code>Operation<T></code> and track progress of the operation using <code>Value()</code>, while the operation is not done (using <code>IsDone()</code>). 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 <code>PollUntilDone()</code>.</p>
|
|
<pre><code class="lang-cpp"> 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;
|
|
}
|
|
</code></pre>
|
|
<h4 id="azurecorecontext"><code>Azure::Core::Context</code></h4>
|
|
<p>Most Azure SDK Service Client methods accept an optional <code>Azure::Core::Context</code> parameter, which is used to enable cancellation of the operation or to
|
|
establish an absolute deadline for the operation.</p>
|
|
<p>This 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
|
|
snippet below will cancel a blob client upload after 5 seconds.</p>
|
|
<!-- @insert_snippet: CreateBlobContext -->
|
|
<pre><code class="lang-cpp"> Azure::Core::Context cancelledIn5s{
|
|
std::chrono::system_clock::now() + std::chrono::seconds(5)};
|
|
|
|
auto containerClient = BlobContainerClient::CreateFromConnectionString(
|
|
GetConnectionString(), containerName + std::to_string(i));
|
|
containerClient.CreateIfNotExists({}, cancelledIn5s);
|
|
for (int j = 0; j < 3; ++j)
|
|
{
|
|
BlockBlobClient blobClient
|
|
= containerClient.GetBlockBlobClient(blobName + std::to_string(j));
|
|
blobClient.UploadFrom(
|
|
reinterpret_cast<const uint8_t*>(blobContent.data()),
|
|
blobContent.size(),
|
|
{},
|
|
cancelledIn5s);
|
|
}
|
|
</code></pre>
|
|
<p><code>Context</code> objects can also be directly cancelled using the <code>Cancel()</code> method.</p>
|
|
<p><code>Context</code> objects form a directed tree, where a child context can be created from a parent context.
|
|
The context tree is unidirectional and acyclic.</p>
|
|
<p>These are the basic operations that can be performed on a <code>Context</code> object:</p>
|
|
<ul>
|
|
<li>Create a child context from a parent context with a Key/Value pair. This is useful for associating metadata with a context.</li>
|
|
<li>Create a child context from a parent context with a deadline. This is useful for setting a timeout.</li>
|
|
<li>Cancel a context. This will cancel the context and all its children. Note that there is no way of un-cancelling a context.</li>
|
|
<li>Check if a context is cancelled.</li>
|
|
</ul>
|
|
<p>When a context is copied from another context, the copied context will share state with the original context.
|
|
This means that if the original context is cancelled, the copied context will also be cancelled.</p>
|
|
<p>Cancellation of a <code>Context</code> is a permanent operation. Once a context is cancelled, it cannot be un-cancelled.</p>
|
|
<p>When a client operation fails with an <code>Azure::Core::OperationCancelledException</code>, it is typically due to a <code>Context</code> getting cancelled. This exception can be caught and handled by the application.</p>
|
|
<h4 id="public-private-and-internal-types">Public, Private, and Internal Types</h4>
|
|
<p>For the most part, the APIs defined in the Azure SDK for C++ fall into three categories:</p>
|
|
<ul>
|
|
<li><strong>Public</strong>: These are the types that are intended to be used by the consumers of the SDK.
|
|
They are part of the public API and are stable. Breaking changes to these types will be avoided as much
|
|
as possible. All public types and functions are located are in the <code>Azure</code> root namespace.</li>
|
|
<li><strong>Internal</strong>: These are the types that are used internally by the packages within the SDK.
|
|
They 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.
|
|
Breaking changes to these types are allowed, within certain constraints. These types are located in an <code>Azure</code> namespace within the <code>_internal</code> terminal namespace (for instance, <code>Azure::Core::Http::Policies::_internal::RequestActivityPolicy</code>).</li>
|
|
<li><strong>Private</strong>: These are the types that are used internally to individual Azure SDK Packages.
|
|
They are not intended to be used by the consumers of the SDK, nor by other SDK packages. Breaking changes
|
|
to these types are allowed. These types are located in an <code>Azure</code> namespace within the <code>_detail</code> terminal namespace.</li>
|
|
</ul>
|
|
<p>Within the source tree, Internal types are typically declared in directories named "internal", and Private types are typically declared in directories named "private".</p>
|
|
<h4 id="interacting-with-azure-sdk-for-c">Interacting with Azure SDK for C++</h4>
|
|
<p>Static SDK members should not be accessed and SDK functions should not be called before the static initialization phase is finished.</p>
|
|
<h4 id="visual-studio---cmakesettingsjson">Visual Studio - CMakeSettings.json</h4>
|
|
<p>When building your application via Visual Studio, you can create and update a <code>CMakeSettings.json</code> file and include the following properties to let Visual Studio know where the packages are installed and which triplet needs to be used:</p>
|
|
<pre><code class="lang-json">{
|
|
"configurations": [
|
|
{
|
|
"cmakeToolchain": "<path to vcpkg repo>/vcpkg/scripts/buildsystems/vcpkg.cmake",
|
|
"variables": [
|
|
{
|
|
"name": "VCPKG_TARGET_TRIPLET",
|
|
"value": "x64-windows",
|
|
"type": "STRING"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
</code></pre>
|
|
<h3 id="azure-requirements">Azure Requirements</h3>
|
|
<p>To call Azure services, you must first have an Azure subscription. Sign up for a <a href="https://azure.microsoft.com/pricing/free-trial/">free trial</a> or use your <a href="https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/">MSDN subscriber benefits</a>.</p>
|
|
<h2 id="packages-available">Packages available</h2>
|
|
<p>Each service might have a number of libraries available. These libraries follow the <a href="https://azure.github.io/azure-sdk/cpp_introduction.html">Azure SDK Design Guidelines for C++</a> 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 <a href="https://github.com/Azure/azure-sdk-for-cpp/blob/main/sdk/core/azure-core/README.md">Azure::Core</a>.</p>
|
|
<p>The client libraries can be identified by the naming used for their folder, package, and namespace. Each will start with <code>azure</code>, followed by the service category, and then the name of the service. For example <code>azure-storage-blobs</code>.</p>
|
|
<p>For a complete list of available packages, please see the <a href="https://azure.github.io/azure-sdk/releases/latest/#c">latest available packages</a> page.</p>
|
|
<blockquote>
|
|
<p>NOTE: If you need to ensure your code is ready for production we strongly recommend using one of the stable, non-beta libraries.</p>
|
|
</blockquote>
|
|
<h3 id="vcpkg">Vcpkg</h3>
|
|
<p>The following SDK library releases are available on <a href="https://github.com/microsoft/vcpkg">vcpkg</a>:</p>
|
|
<ul>
|
|
<li><code>azure-core-cpp</code></li>
|
|
<li><code>azure-identity-cpp</code></li>
|
|
<li><code>azure-security-attestation-cpp</code></li>
|
|
<li><code>azure-security-keyvault-certificates-cpp</code></li>
|
|
<li><code>azure-security-keyvault-keys-cpp</code></li>
|
|
<li><code>azure-security-keyvault-secrets-cpp</code></li>
|
|
<li><code>azure-storage-blobs-cpp</code></li>
|
|
<li><code>azure-storage-files-datalake-cpp</code></li>
|
|
<li><code>azure-storage-files-shares-cpp</code></li>
|
|
<li><code>azure-storage-queues-cpp</code></li>
|
|
</ul>
|
|
<blockquote>
|
|
<p>NOTE: In case of getting linker errors when consuming the SDK on Windows, make sure that <a href="https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/users/triplets.md">vcpkg triplet</a> being consumed matches the <a href="https://docs.microsoft.com/cpp/build/reference/md-mt-ld-use-run-time-library?view=msvc-160">CRT link flags</a> being set for your app or library build. See also <code>MSVC_USE_STATIC_CRT</code> build flag.</p>
|
|
</blockquote>
|
|
<h2 id="openssl-version">OpenSSL Version</h2>
|
|
<p>Several 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.</p>
|
|
<h3 id="using-a-specific-version-of-openssl">Using a specific version of OpenSSL</h3>
|
|
<p>If 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.
|
|
For example, if you want to use OpenSSL 1.1.1, you should create a folder named <code>vcpkg-custom-ports</code> next to to your vcpkg.json file.</p>
|
|
<p>Navigate 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
|
|
in vcpkg. Then, copy the contents of the <code>ports/openssl</code> folder from the vcpkg repo to the <code>vcpkg-custom-ports</code> folder you created earlier:</p>
|
|
<pre><code class="lang-sh">cd <your vcpkg repo>
|
|
git checkout 3b3bd424827a1f7f4813216f6b32b6c61e386b2e
|
|
cd ports
|
|
cp -r openssl <the location of the vcpkg-custom-ports directory listed above>
|
|
</code></pre>
|
|
<p>This will copy the port information for OpenSSL 1.1.1n to your vcpkg-custom-ports directory.</p>
|
|
<p>Once that is done, you can install the custom port of OpenSSL 1.1.1n using the vcpkg tool:</p>
|
|
<pre><code class="lang-sh">vcpkg install --overlay-ports=<path to the vcpkg-custom-ports above>
|
|
</code></pre>
|
|
<p>If you are building using CMAKE, you can instruct CMAKE to apply the overlay ports using the following command line switches:</p>
|
|
<pre><code class="lang-sh">cmake -DVCPKG_MANIFEST_MODE=ON -DVCPKG_OVERLAY_PORTS=<path to the vcpkg-custom-ports above> -DVCPKG_MANIFEST_DIR=<path to the directory containing the vcpkg.json file>
|
|
</code></pre>
|
|
<p>In 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 <code>x64-windows-static</code> or <code>x64-windows-dynamic</code> depending on whether you want to use the static or dynamic version of OpenSSL.
|
|
Similarly you can use the x64-linux-dynamic and x64-linux-static triplet to specify consumption of libraries as a shared object or dynamic.</p>
|
|
<h3 id="using-the-system-package-manager-to-install-openssl">Using the system package manager to install OpenSSL</h3>
|
|
<p>If you are using a Linux distribution that uses the system package manager to install libraries, you can use the system package
|
|
manager to install OpenSSL.</p>
|
|
<p>The vcpkg team has a <a href="https://devblogs.microsoft.com/cppblog/using-system-package-manager-dependencies-with-vcpkg/">feature</a>
|
|
which allows you to use the system package manager to install dependencies.</p>
|
|
<h2 id="need-help">Need help</h2>
|
|
<ul>
|
|
<li>For reference documentation visit the <a href="https://azure.github.io/azure-sdk-for-cpp">Azure SDK for C++ documentation</a>.</li>
|
|
<li>For tutorials, samples, quick starts and other documentation, visit <a href="https://docs.microsoft.com/azure/">Azure for C++ Developers</a>.</li>
|
|
<li>File an issue via <a href="https://github.com/Azure/azure-sdk-for-cpp/issues/new/choose">GitHub Issues</a>.</li>
|
|
</ul>
|
|
<h2 id="navigating-the-repository">Navigating the repository</h2>
|
|
<h3 id="main-branch">Main branch</h3>
|
|
<p>The main branch has the most recent code with new features and bug fixes. It does <strong>not</strong> represent latest released <strong>beta</strong> or <strong>GA</strong> SDK.</p>
|
|
<h3 id="release-branches-release-tagging">Release branches (Release tagging)</h3>
|
|
<p>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 <code><package-name>_<package-version></code>. For more information please see <a href="https://github.com/Azure/azure-sdk/blob/main/docs/policies/repobranching.md#release-tagging">our branching strategy</a>.</p>
|
|
<h2 id="contributing">Contributing</h2>
|
|
<p>For details on contributing to this repository, see the <a href="https://github.com/Azure/azure-sdk-for-cpp/blob/main/CONTRIBUTING.md">contributing guide</a>.</p>
|
|
<p>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 <a href="https://cla.microsoft.com">Microsoft's CLA</a>.</p>
|
|
<p>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.</p>
|
|
<p>This project has adopted the <a href="https://opensource.microsoft.com/codeofconduct/">Microsoft Open Source Code of Conduct</a>. For more information see the <a href="https://opensource.microsoft.com/codeofconduct/faq/">Code of Conduct FAQ</a> or contact <a href="mailto:opencode@microsoft.com">opencode@microsoft.com</a> with any additional questions or comments.</p>
|
|
<h3 id="additional-helpful-links-for-contributors">Additional Helpful Links for Contributors</h3>
|
|
<p>Many people all over the world have helped make this project better. You'll want to check out:</p>
|
|
<ul>
|
|
<li><a href="https://github.com/azure/azure-sdk-for-cpp/issues?q=is%3Aopen+is%3Aissue+label%3A%22up+for+grabs%22">What are some good first issues for new contributors to the repo?</a></li>
|
|
<li><a href="https://github.com/Azure/azure-sdk-for-cpp/blob/main/CONTRIBUTING.md#developer-guide">How to build and test your change</a></li>
|
|
<li><a href="https://github.com/Azure/azure-sdk-for-cpp/blob/main/CONTRIBUTING.md#pull-requests">How you can make a change happen!</a></li>
|
|
<li>Frequently Asked Questions (FAQ) and Conceptual Topics in the detailed <a href="https://github.com/azure/azure-sdk-for-cpp/wiki">Azure SDK for C++ wiki</a>.</li>
|
|
</ul>
|
|
<!-- ### Community-->
|
|
<h3 id="reporting-security-issues-and-security-bugs">Reporting security issues and security bugs</h3>
|
|
<p>Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) <a href="mailto:secure@microsoft.com">secure@microsoft.com</a>. 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 <a href="https://www.microsoft.com/msrc/faqs-report-an-issue">Security TechCenter</a>.</p>
|
|
<h3 id="license">License</h3>
|
|
<p>Azure SDK for C++ is licensed under the <a href="https://github.com/Azure/azure-sdk-for-cpp/blob/main/LICENSE.txt">MIT</a> license.</p>
|
|
<h3 id="trademarks">Trademarks</h3>
|
|
<p>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 <a href="https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general">Microsoft's Trademark & Brand Guidelines</a>. 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.</p>
|
|
<p><img src="https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-cpp%2FREADME.png" alt="Impressions"></p>
|
|
</article>
|
|
</div>
|
|
|
|
<div class="hidden-sm col-md-2" role="complementary">
|
|
<div class="sideaffix">
|
|
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<footer>
|
|
<div class="grad-bottom"></div>
|
|
<div class="footer">
|
|
<div class="container">
|
|
<span class="pull-right">
|
|
<a href="#top">Back to top</a>
|
|
</span>
|
|
Azure SDK for C++
|
|
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
|
|
<script type="text/javascript" src="styles/docfx.vendor.js"></script>
|
|
<script type="text/javascript" src="styles/docfx.js"></script>
|
|
<script type="text/javascript" src="styles/main.js"></script>
|
|
</body>
|
|
</html>
|