Stop disabling security warnings in get_env.hpp; Fixed all incorrect … (#4655)

* Disable deprecation warnings in cmakelists.txt to avoid introducing new concepts; removed unnecessary uses of get_env.hpp

* Removed use of GetEnvHelper from AMQP samples

* Removed special case for get_env.hpp
This commit is contained in:
Larry Osterman 2023-06-01 12:50:45 -07:00 committed by GitHub
parent 46dd5674a6
commit b303a70eaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 84 additions and 171 deletions

View File

@ -43,9 +43,6 @@ UseTab: Never
IncludeCategories:
- Regex: '^<windows.h>$'
Priority: 80
# Note: get_env.hpp must be included before any other Azure SDK headers.
- Regex: '^["<]get_env.hpp'
Priority: 10
- Regex: '<[[:alnum:]_.]+>'
Priority: 90
- Regex: '<Azure/.*>'

View File

@ -7,22 +7,8 @@
#pragma once
#if !defined(_MSC_VER)
// Linux and macOS
#include <cstdlib>
#else
#define _CRT_SECURE_NO_WARNINGS
#if !defined(WIN32_LEAN_AND_MEAN)
#define WIN32_LEAN_AND_MEAN
#endif
#if !defined(NOMINMAX)
#define NOMINMAX
#endif
#include <windows.h>
// The AppStore partition for the Win32 API surface does not include a definition for std::getenv,
// so we provide our own definition here.
#if !defined(WINAPI_PARTITION_DESKTOP) || WINAPI_PARTITION_DESKTOP
// Win32
#include <cstdlib>
@ -33,7 +19,6 @@ char* getenv(const char* name);
}
#endif
#endif
#include <stdexcept>
#include <string>
@ -41,7 +26,14 @@ struct GetEnvHelper
{
static std::string GetEnv(char const* env)
{
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
auto const val = std::getenv(env);
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
if (val == nullptr)
{
throw std::runtime_error("Could not find required environment variable: " + std::string(env));

View File

@ -9,8 +9,6 @@
*
*/
#include "get_env.hpp"
#include <azure/storage/blobs.hpp>
#include <exception>

View File

@ -16,6 +16,10 @@ project(vcpkg-all-smoke LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
add_executable (
vcpkg-all-smoke
src/main

View File

@ -6,8 +6,6 @@
*
*/
#include "get_env.hpp"
#include <azure/attestation.hpp>
#include <azure/core.hpp>
#include <azure/core/internal/json/json.hpp>

View File

@ -21,14 +21,13 @@
*
*/
#include <get_env.hpp>
#include "attestation_collateral.hpp"
#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iostream>
#include <thread>
#include <vector>

View File

@ -21,14 +21,13 @@
*
*/
#include <get_env.hpp>
#include "attestation_collateral.hpp"
#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iostream>
#include <thread>
@ -90,13 +89,3 @@ issuancerules {
}
return 0;
}
std::string GetEnv(char const* env)
{
auto const val = std::getenv(env);
if (val == nullptr)
{
throw std::runtime_error("Could not find required environment variable: " + std::string(env));
}
return std::string(val);
}

View File

@ -21,14 +21,13 @@
*
*/
#include <get_env.hpp>
#include "attestation_collateral.hpp"
#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iostream>
#include <thread>

View File

@ -21,14 +21,13 @@
*
*/
#include <get_env.hpp>
#include "attestation_collateral.hpp"
#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iostream>
#include <thread>

View File

@ -21,14 +21,13 @@
*
*/
#include <get_env.hpp>
#include "attestation_collateral.hpp"
#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iostream>
#include <thread>

View File

@ -17,12 +17,11 @@
*
*/
#include <get_env.hpp>
#include <azure/attestation.hpp>
#include <azure/identity.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iostream>
#include <memory>
#include <thread>

View File

@ -13,11 +13,10 @@
*
*/
#include <get_env.hpp>
#include <azure/attestation.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iostream>
#include <thread>

View File

@ -15,11 +15,10 @@
*
*/
#include <get_env.hpp>
#include <azure/attestation.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iostream>
#include <thread>

View File

@ -15,11 +15,10 @@
*
*/
#include <get_env.hpp>
#include <azure/attestation.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iostream>
#include <thread>

View File

@ -23,14 +23,13 @@
*
*/
#include <get_env.hpp>
#include "cryptohelpers.hpp"
#include <azure/attestation.hpp>
#include <azure/identity.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iomanip>
#include <iostream>
#include <thread>

View File

@ -18,14 +18,13 @@
*
*/
#include <get_env.hpp>
#include "cryptohelpers.hpp"
#include <azure/attestation.hpp>
#include <azure/identity.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iomanip>
#include <iostream>
#include <thread>
@ -37,17 +36,17 @@ using namespace Azure::Security::Attestation::Models;
using namespace std::chrono_literals;
using namespace Azure::Core;
std::string GetEnv(char const* env);
int main()
{
try
{
// create an administration client
auto const credential = std::make_shared<Azure::Identity::ClientSecretCredential>(
GetEnv("AZURE_TENANT_ID"), GetEnv("AZURE_CLIENT_ID"), GetEnv("AZURE_CLIENT_SECRET"));
AttestationAdministrationClient adminClient(
AttestationAdministrationClient::Create(GetEnv("ATTESTATION_ISOLATED_URL"), credential));
GetEnvHelper::GetEnv("AZURE_TENANT_ID"),
GetEnvHelper::GetEnv("AZURE_CLIENT_ID"),
GetEnvHelper::GetEnv("AZURE_CLIENT_SECRET"));
AttestationAdministrationClient adminClient(AttestationAdministrationClient::Create(
GetEnvHelper::GetEnv("ATTESTATION_ISOLATED_URL"), credential));
// Retrieve the SGX Attestation Policy from this attestation service instance.
Azure::Response<AttestationToken<IsolatedModeCertificateListResult>> const policyCertificates
@ -89,13 +88,3 @@ int main()
}
return 0;
}
std::string GetEnv(char const* env)
{
auto const val = std::getenv(env);
if (val == nullptr)
{
throw std::runtime_error("Could not find required environment variable: " + std::string(env));
}
return std::string(val);
}

View File

@ -14,12 +14,11 @@
*
*/
#include <get_env.hpp>
#include <azure/attestation.hpp>
#include <azure/identity.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iomanip>
#include <iostream>
#include <thread>

View File

@ -16,8 +16,6 @@
*
*/
#include <get_env.hpp>
#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>
#include <azure/core/cryptography/hash.hpp>
@ -25,6 +23,7 @@
#include <azure/identity.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iomanip>
#include <iostream>
#include <thread>

View File

@ -17,8 +17,6 @@
*
*/
#include <get_env.hpp>
#include "cryptohelpers.hpp"
#include <azure/attestation.hpp>
@ -28,6 +26,7 @@
#include <azure/identity.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iomanip>
#include <iostream>
#include <thread>

View File

@ -16,8 +16,6 @@
*
*/
#include <get_env.hpp>
#include <azure/attestation.hpp>
#include <azure/core/base64.hpp>
#include <azure/core/cryptography/hash.hpp>
@ -25,6 +23,7 @@
#include <azure/identity.hpp>
#include <chrono>
#include <get_env.hpp>
#include <iomanip>
#include <iostream>
#include <thread>

View File

@ -17,8 +17,6 @@
*
*/
#include <get_env.hpp>
#include "cryptohelpers.hpp"
#include <azure/attestation.hpp>
@ -29,6 +27,7 @@
#include <cassert>
#include <chrono>
#include <get_env.hpp>
#include <iomanip>
#include <iostream>
#include <thread>

View File

@ -1,9 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-Licence-Identifier: MIT
#undef _CRT_SECURE_NO_WARNINGS
#include <get_env.hpp>
#include <azure/core/amqp/connection.hpp>
#include <azure/core/amqp/message_sender.hpp>
@ -24,7 +21,7 @@ int main()
std::string targetEntity = credentials->GetEntityPath();
if (targetEntity.empty())
{
targetEntity = GetEnvHelper::GetEnv("EVENTHUB_NAME");
targetEntity = std::getenv("EVENTHUB_NAME");
}
Azure::Core::Amqp::_internal::ConnectionOptions connectionOptions;
connectionOptions.ContainerId = "some";

View File

@ -1,9 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-Licence-Identifier: MIT
#undef _CRT_SECURE_NO_WARNINGS
#include <get_env.hpp>
#include <azure/core/amqp/connection.hpp>
#include <azure/core/amqp/connection_string_credential.hpp>
#include <azure/core/amqp/management.hpp>
@ -160,14 +157,14 @@ int main()
// Retrieve the eventhub connection string so we can extract the host name and entity name. We
// are NOT using the connection string to authenticate with the eventhub, only to retrieve the
// host name and entity (if present).
std::string eventhubConnectionString = GetEnvHelper::GetEnv("EVENTHUB_CONNECTION_STRING");
std::string eventhubConnectionString = std::getenv("EVENTHUB_CONNECTION_STRING");
Azure::Core::Amqp::_internal::ConnectionStringParser connectionParser(eventhubConnectionString);
std::string eventhubsHost = connectionParser.GetHostName();
std::string eventhubsEntity = connectionParser.GetEntityPath();
if (eventhubsEntity.empty())
{
eventhubsEntity = GetEnvHelper::GetEnv("EVENTHUB_NAME");
eventhubsEntity = std::getenv("EVENTHUB_NAME");
}
// Establish the connection to the eventhub.
@ -179,9 +176,9 @@ int main()
connectionParser.GetHostName(), connectionOptions);
auto credential{std::make_shared<Azure::Identity::ClientSecretCredential>(
GetEnvHelper::GetEnv("SAMPLES_TENANT_ID"),
GetEnvHelper::GetEnv("SAMPLES_CLIENT_ID"),
GetEnvHelper::GetEnv("SAMPLES_CLIENT_SECRET"))};
std::getenv("SAMPLES_TENANT_ID"),
std::getenv("SAMPLES_CLIENT_ID"),
std::getenv("SAMPLES_CLIENT_SECRET"))};
// Establish a session to the eventhub.
Azure::Core::Amqp::_internal::SessionOptions sessionOptions;

View File

@ -1,9 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-Licence-Identifier: MIT
#undef _CRT_SECURE_NO_WARNINGS
#include <get_env.hpp>
#include <azure/core/amqp/connection.hpp>
#include <azure/core/amqp/message_receiver.hpp>
#include <azure/core/amqp/network/sasl_transport.hpp>
@ -15,7 +12,7 @@
int main()
{
std::string eventhubConnectionString = GetEnvHelper::GetEnv("EVENTHUB_CONNECTION_STRING");
std::string eventhubConnectionString = std::getenv("EVENTHUB_CONNECTION_STRING");
auto credential
= std::make_shared<Azure::Core::Amqp::_internal::ServiceBusSasConnectionStringCredential>(
@ -23,7 +20,7 @@ int main()
std::string entityPath = credential->GetEntityPath();
if (entityPath.empty())
{
entityPath = GetEnvHelper::GetEnv("EVENTHUB_NAME");
entityPath = std::getenv("EVENTHUB_NAME");
}
Azure::Core::Amqp::_internal::ConnectionOptions connectionOptions;

View File

@ -1,9 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-Licence-Identifier: MIT
#undef _CRT_SECURE_NO_WARNINGS
#include <get_env.hpp>
#include <azure/core/amqp/connection.hpp>
#include <azure/core/amqp/connection_string_credential.hpp>
#include <azure/core/amqp/message_sender.hpp>
@ -15,7 +12,7 @@
int main()
{
std::string eventhubConnectionString = GetEnvHelper::GetEnv("EVENTHUB_CONNECTION_STRING");
std::string eventhubConnectionString = std::getenv("EVENTHUB_CONNECTION_STRING");
auto credential{
std::make_shared<Azure::Core::Amqp::_internal::ServiceBusSasConnectionStringCredential>(
@ -23,7 +20,7 @@ int main()
std::string entityPath = credential->GetEntityPath();
if (entityPath.empty())
{
entityPath = GetEnvHelper::GetEnv("EVENTHUB_NAME");
entityPath = std::getenv("EVENTHUB_NAME");
}
Azure::Core::Amqp::_internal::ConnectionOptions connectionOptions;
connectionOptions.ContainerId = "some";

View File

@ -1,9 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-Licence-Identifier: MIT
#undef _CRT_SECURE_NO_WARNINGS
#include <get_env.hpp>
#include <azure/core/amqp/connection.hpp>
#include <azure/core/amqp/message_receiver.hpp>
#include <azure/core/amqp/network/sasl_transport.hpp>
@ -15,7 +12,7 @@
int main()
{
std::string eventhubConnectionString = GetEnvHelper::GetEnv("EVENTHUB_CONNECTION_STRING");
std::string eventhubConnectionString = std::getenv("EVENTHUB_CONNECTION_STRING");
auto credential
= std::make_shared<Azure::Core::Amqp::_internal::ServiceBusSasConnectionStringCredential>(
@ -23,7 +20,7 @@ int main()
std::string entityPath = credential->GetEntityPath();
if (entityPath.empty())
{
entityPath = GetEnvHelper::GetEnv("EVENTHUB_NAME");
entityPath = std::getenv("EVENTHUB_NAME");
}
Azure::Core::Amqp::_internal::ConnectionOptions connectionOptions;

View File

@ -1,9 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-Licence-Identifier: MIT
#undef _CRT_SECURE_NO_WARNINGS
#include <get_env.hpp>
#include <azure/core/amqp/connection.hpp>
#include <azure/core/amqp/connection_string_credential.hpp>
#include <azure/core/amqp/message_sender.hpp>
@ -21,7 +18,7 @@ int main()
{
// Retrieve the eventhub connection string so we can extract the host name and entity name. We are
// NOT using the connection string to connect to the eventhub.
std::string eventhubConnectionString = GetEnvHelper::GetEnv("EVENTHUB_CONNECTION_STRING");
std::string eventhubConnectionString = std::getenv("EVENTHUB_CONNECTION_STRING");
Azure::Core::Amqp::_internal::ConnectionStringParser connectionStringCredential(
eventhubConnectionString);
std::string eventhubsHost = connectionStringCredential.GetHostName();
@ -31,14 +28,14 @@ int main()
// environment variable.
if (eventhubsEntity.empty())
{
eventhubsEntity = GetEnvHelper::GetEnv("EVENTHUB_NAME");
eventhubsEntity = std::getenv("EVENTHUB_NAME");
}
// Establish credentials for the eventhub client.
auto credential{std::make_shared<Azure::Identity::ClientSecretCredential>(
GetEnvHelper::GetEnv("SAMPLES_TENANT_ID"),
GetEnvHelper::GetEnv("SAMPLES_CLIENT_ID"),
GetEnvHelper::GetEnv("SAMPLES_CLIENT_SECRET"))};
std::getenv("SAMPLES_TENANT_ID"),
std::getenv("SAMPLES_CLIENT_ID"),
std::getenv("SAMPLES_CLIENT_SECRET"))};
Azure::Core::Amqp::_internal::ConnectionOptions connectionOptions;
connectionOptions.ContainerId = "some";

View File

@ -7,6 +7,10 @@ project (azure-identity-samples LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
add_executable(azure_cli_credential_sample azure_cli_credential.cpp)
target_link_libraries(azure_cli_credential_sample PRIVATE azure-identity service)
target_include_directories(azure_cli_credential_sample PRIVATE .)

View File

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include <get_env.hpp>
#include <azure/identity/client_certificate_credential.hpp>
#include <azure/service/client.hpp>

View File

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include <get_env.hpp>
#include <azure/identity/client_secret_credential.hpp>
#include <azure/service/client.hpp>

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/identity.hpp>
#include <azure/keyvault/administration.hpp>

View File

@ -3,6 +3,10 @@
cmake_minimum_required (VERSION 3.13)
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
add_subdirectory(certificate-basic-operations)
add_subdirectory(certificate-get-certificates)
add_subdirectory(certificate-import-certificate)

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/identity.hpp>
#include <azure/keyvault/certificates.hpp>

View File

@ -16,8 +16,6 @@
*
*/
#include "get_env.hpp"
#include <azure/identity.hpp>
#include <azure/keyvault/certificates.hpp>

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/core.hpp>
#include <azure/identity.hpp>
#include <azure/keyvault/certificates.hpp>

View File

@ -3,6 +3,10 @@
cmake_minimum_required (VERSION 3.13)
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
add_subdirectory(sample1-hello-world)
add_subdirectory(sample2-backup-and-restore)
add_subdirectory(sample3-get-keys)

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/core.hpp>
#include <azure/identity.hpp>
#include <azure/keyvault/keys.hpp>

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/core.hpp>
#include <azure/identity.hpp>
#include <azure/keyvault/keys.hpp>

View File

@ -14,8 +14,6 @@
*
*/
#include "get_env.hpp"
#include <azure/core.hpp>
#include <azure/identity.hpp>
#include <azure/keyvault/keys.hpp>

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/core.hpp>
#include <azure/identity.hpp>
#include <azure/keyvault/keys.hpp>

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/core.hpp>
#include <azure/identity.hpp>
#include <azure/keyvault/keys.hpp>

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/core.hpp>
#include <azure/identity.hpp>
#include <azure/keyvault/keys.hpp>

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/core.hpp>
#include <azure/identity.hpp>
#include <azure/keyvault/keyvault_keys.hpp>

View File

@ -3,6 +3,10 @@
cmake_minimum_required (VERSION 3.13)
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
add_subdirectory(sample1-basic-operations)
add_subdirectory(sample2-backup-restore)
add_subdirectory(sample3-delete-recover)

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/identity.hpp>
#include <azure/keyvault/secrets.hpp>

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/identity.hpp>
#include <azure/keyvault/secrets.hpp>

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/identity.hpp>
#include <azure/keyvault/secrets.hpp>

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/identity.hpp>
#include <azure/keyvault/secrets.hpp>

View File

@ -13,8 +13,6 @@
*
*/
#include "get_env.hpp"
#include <azure/identity.hpp>
#include <azure/keyvault/certificates.hpp>
#include <azure/keyvault/keys.hpp>

View File

@ -3,6 +3,10 @@
cmake_minimum_required (VERSION 3.13)
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
add_executable(blob-getting-started blob_getting_started.cpp)
target_link_libraries(blob-getting-started PRIVATE azure-storage-blobs get-env-helper)
create_per_service_target_build_for_sample(storage blob-getting-started)

View File

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "get_env.hpp"
#include <azure/storage/blobs.hpp>
#include <cstdio>

View File

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "get_env.hpp"
#include <azure/storage/blobs.hpp>
#include <cstdio>

View File

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "get_env.hpp"
#include <azure/storage/blobs.hpp>
#include <iostream>

View File

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "get_env.hpp"
#include <azure/storage/blobs.hpp>
#include <azure/storage/common/storage_exception.hpp>

View File

@ -1,10 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "get_env.hpp"
#include <azure/storage/blobs.hpp>
#include <azure/storage/common/crypt.hpp>
#include <azure/storage/common/storage_exception.hpp>
#include <cstdio>
#include <iostream>

View File

@ -3,6 +3,10 @@
cmake_minimum_required (VERSION 3.13)
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
add_executable(datalake-getting-started datalake_getting_started.cpp)
create_per_service_target_build_for_sample(storage datalake-getting-started)
target_link_libraries(datalake-getting-started PRIVATE azure-storage-files-datalake get-env-helper)

View File

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "get_env.hpp"
#include <azure/storage/files/datalake.hpp>
#include <cstdio>

View File

@ -3,6 +3,10 @@
cmake_minimum_required (VERSION 3.13)
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
add_executable(file-share-getting-started file_share_getting_started.cpp)
create_per_service_target_build_for_sample(storage file-share-getting-started)
target_link_libraries(file-share-getting-started PRIVATE azure-storage-files-shares get-env-helper)

View File

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "get_env.hpp"
#include <azure/storage/files/shares.hpp>
#include <cstdio>

View File

@ -3,6 +3,10 @@
cmake_minimum_required (VERSION 3.13)
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
add_executable(queue-getting-started queue_getting_started.cpp)
target_link_libraries(queue-getting-started PRIVATE azure-storage-queues get-env-helper)
create_per_service_target_build_for_sample(storage queue-getting-started)

View File

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "get_env.hpp"
#include <azure/core/base64.hpp>
#include <azure/storage/queues.hpp>

View File

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "get_env.hpp"
#include <azure/storage/queues.hpp>
#include <cstdio>