From e19dc2371c4886cad098dc111ae0fb38352b4513 Mon Sep 17 00:00:00 2001 From: Larry Osterman Date: Tue, 16 Jul 2024 10:29:54 -0700 Subject: [PATCH] Use GetTestCredentials in eventhubs admin client; updated samples to allow sample execution to be disabled (#5799) * Use GetTestCredentials in eventhubs admin client; updated samples to allow sample execution to be disabled * Made sample execution optional * re-enabled building keyvault samples * Disabled RetrieveMultipleEvents test * Disabled RetrieveMultipleEvents test * Pull request feedback --- cmake-modules/AzureBuildTargetForCI.cmake | 18 +++++++++-- .../samples/attestation/CMakeLists.txt | 2 +- .../samples/basic-operations/CMakeLists.txt | 2 +- .../policy-certificates/CMakeLists.txt | 2 +- .../samples/policy/CMakeLists.txt | 2 +- .../samples/basic-operations/CMakeLists.txt | 2 +- .../samples/consume-events/CMakeLists.txt | 2 +- .../samples/produce-events/CMakeLists.txt | 2 +- .../test/ut/consumer_client_test.cpp | 4 ++- .../test/ut/eventhubs_admin_client.cpp | 3 +- .../test/ut/eventhubs_admin_client.hpp | 7 +++- .../azure-identity/samples/CMakeLists.txt | 32 +++++++++---------- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../sample1-hello-world/CMakeLists.txt | 2 +- .../sample2-backup-and-restore/CMakeLists.txt | 2 +- .../samples/sample3-get-keys/CMakeLists.txt | 2 +- .../sample4-encrypt-decrypt/CMakeLists.txt | 2 +- .../sample5-sign-verify/CMakeLists.txt | 2 +- .../sample6-wrap-unwrap/CMakeLists.txt | 2 +- .../sample7-key-rotation/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../sample1-basic-operations/CMakeLists.txt | 2 +- .../sample2-backup-restore/CMakeLists.txt | 2 +- .../sample3-delete-recover/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- 29 files changed, 66 insertions(+), 46 deletions(-) diff --git a/cmake-modules/AzureBuildTargetForCI.cmake b/cmake-modules/AzureBuildTargetForCI.cmake index 3e302a231..e4919feb8 100644 --- a/cmake-modules/AzureBuildTargetForCI.cmake +++ b/cmake-modules/AzureBuildTargetForCI.cmake @@ -32,6 +32,20 @@ macro(create_per_service_target_build_for_sample service target) if(CMAKE_GENERATOR MATCHES "Visual Studio.*") SET(binary "Release/${binary}") endif() - file(APPEND ${CMAKE_BINARY_DIR}/${service}-samples.txt "${CMAKE_CURRENT_BINARY_DIR}/${binary}\n") - + + set(RUN_SAMPLE TRUE) + if(${ARGC} GREATER 2) + set(extra_args "${ARGN}") + foreach(arg IN LISTS extra_args) + if (${arg} MATCHES "DISABLE_RUN") + set(RUN_SAMPLE FALSE) + message("Disabling sample execution for ${service}/${binary}") + else() + message(FATAL_ERROR "Unknown extra argument: ${arg}") + endif() + endforeach() + endif() + if (RUN_SAMPLE) + file(APPEND ${CMAKE_BINARY_DIR}/${service}-samples.txt "${CMAKE_CURRENT_BINARY_DIR}/${binary}\n") + endif() endmacro() diff --git a/sdk/attestation/azure-security-attestation/samples/attestation/CMakeLists.txt b/sdk/attestation/azure-security-attestation/samples/attestation/CMakeLists.txt index 2d72a6bcb..e91815cfc 100644 --- a/sdk/attestation/azure-security-attestation/samples/attestation/CMakeLists.txt +++ b/sdk/attestation/azure-security-attestation/samples/attestation/CMakeLists.txt @@ -15,7 +15,7 @@ add_executable ( attestation_collateral.cpp attestation_collateral.hpp) -CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename}) +CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename} DISABLE_RUN) target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation get-env-helper) diff --git a/sdk/attestation/azure-security-attestation/samples/basic-operations/CMakeLists.txt b/sdk/attestation/azure-security-attestation/samples/basic-operations/CMakeLists.txt index 9e020ae0d..e0c06e26e 100644 --- a/sdk/attestation/azure-security-attestation/samples/basic-operations/CMakeLists.txt +++ b/sdk/attestation/azure-security-attestation/samples/basic-operations/CMakeLists.txt @@ -12,7 +12,7 @@ add_executable ( attestation-${samplename} ${samplename}.cpp) -CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename}) +CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename} DISABLE_RUN) target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation azure-identity get-env-helper) diff --git a/sdk/attestation/azure-security-attestation/samples/policy-certificates/CMakeLists.txt b/sdk/attestation/azure-security-attestation/samples/policy-certificates/CMakeLists.txt index 5e097362d..3cb7c47ba 100644 --- a/sdk/attestation/azure-security-attestation/samples/policy-certificates/CMakeLists.txt +++ b/sdk/attestation/azure-security-attestation/samples/policy-certificates/CMakeLists.txt @@ -14,7 +14,7 @@ add_executable ( cryptohelpers.hpp ) -CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation-${samplename} attestation) +CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation-${samplename} attestation DISABLE_RUN) target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation azure-identity OpenSSL::Crypto get-env-helper) diff --git a/sdk/attestation/azure-security-attestation/samples/policy/CMakeLists.txt b/sdk/attestation/azure-security-attestation/samples/policy/CMakeLists.txt index db9f592c1..d341b9f33 100644 --- a/sdk/attestation/azure-security-attestation/samples/policy/CMakeLists.txt +++ b/sdk/attestation/azure-security-attestation/samples/policy/CMakeLists.txt @@ -14,7 +14,7 @@ add_executable ( cryptohelpers.hpp ) -CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename}) +CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename} DISABLE_RUN) target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation azure-identity get-env-helper) diff --git a/sdk/eventhubs/azure-messaging-eventhubs/samples/basic-operations/CMakeLists.txt b/sdk/eventhubs/azure-messaging-eventhubs/samples/basic-operations/CMakeLists.txt index f1320f0a0..162dcefae 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/samples/basic-operations/CMakeLists.txt +++ b/sdk/eventhubs/azure-messaging-eventhubs/samples/basic-operations/CMakeLists.txt @@ -12,7 +12,7 @@ add_executable ( eventhubs-${samplename} ${samplename}.cpp) -CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename}) +CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename} DISABLE_RUN) target_link_libraries(eventhubs-${samplename} PRIVATE azure-messaging-eventhubs azure-identity) endmacro() diff --git a/sdk/eventhubs/azure-messaging-eventhubs/samples/consume-events/CMakeLists.txt b/sdk/eventhubs/azure-messaging-eventhubs/samples/consume-events/CMakeLists.txt index ea097c3bd..86214d315 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/samples/consume-events/CMakeLists.txt +++ b/sdk/eventhubs/azure-messaging-eventhubs/samples/consume-events/CMakeLists.txt @@ -12,7 +12,7 @@ add_executable ( eventhubs-${samplename} ${samplename}.cpp) -CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename}) +CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename} DISABLE_RUN) target_link_libraries(eventhubs-${samplename} PRIVATE azure-messaging-eventhubs azure-identity) endmacro() diff --git a/sdk/eventhubs/azure-messaging-eventhubs/samples/produce-events/CMakeLists.txt b/sdk/eventhubs/azure-messaging-eventhubs/samples/produce-events/CMakeLists.txt index d788e22b2..b98f6df96 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/samples/produce-events/CMakeLists.txt +++ b/sdk/eventhubs/azure-messaging-eventhubs/samples/produce-events/CMakeLists.txt @@ -12,7 +12,7 @@ add_executable ( eventhubs-${samplename} ${samplename}.cpp) -CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename}) +CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename} DISABLE_RUN) target_link_libraries(eventhubs-${samplename} PRIVATE azure-messaging-eventhubs azure-identity) endmacro() diff --git a/sdk/eventhubs/azure-messaging-eventhubs/test/ut/consumer_client_test.cpp b/sdk/eventhubs/azure-messaging-eventhubs/test/ut/consumer_client_test.cpp index 66a05bf78..d7e0ba3f2 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/test/ut/consumer_client_test.cpp +++ b/sdk/eventhubs/azure-messaging-eventhubs/test/ut/consumer_client_test.cpp @@ -303,7 +303,7 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test { return name; } - TEST_P(ConsumerClientTest, RetrieveMultipleEvents) + TEST_P(ConsumerClientTest, DISABLED_RetrieveMultipleEvents) { // This test depends on being able to create a new eventhub instance, so skip it on the // emulator. @@ -311,6 +311,8 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test { { GTEST_SKIP(); } + + // Disabled test for now. EventHubsManagement administrationClient; auto eventhubNamespace{administrationClient.GetNamespace(GetEnv("EVENTHUBS_NAMESPACE"))}; diff --git a/sdk/eventhubs/azure-messaging-eventhubs/test/ut/eventhubs_admin_client.cpp b/sdk/eventhubs/azure-messaging-eventhubs/test/ut/eventhubs_admin_client.cpp index 2e35ccb17..9bc3c07a5 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/test/ut/eventhubs_admin_client.cpp +++ b/sdk/eventhubs/azure-messaging-eventhubs/test/ut/eventhubs_admin_client.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -35,7 +34,7 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test { tokenContext.Scopes = {"https://management.azure.com/.default"}; perRetrypolicies.emplace_back( std::make_unique( - std::make_unique(), tokenContext)); + GetTestCredential(), tokenContext)); } std::vector> perCallpolicies; options.Telemetry.ApplicationId = "eventhubs.test"; diff --git a/sdk/eventhubs/azure-messaging-eventhubs/test/ut/eventhubs_admin_client.hpp b/sdk/eventhubs/azure-messaging-eventhubs/test/ut/eventhubs_admin_client.hpp index 5dcc7c984..c7eecda99 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/test/ut/eventhubs_admin_client.hpp +++ b/sdk/eventhubs/azure-messaging-eventhubs/test/ut/eventhubs_admin_client.hpp @@ -5,13 +5,16 @@ #include #include #include +#include #include #include namespace Azure { namespace Messaging { namespace EventHubs { namespace Test { - class EventHubsManagement { + // Derived from Azure::Core::Test::TestBase to get access to GetTestCredential, which has logic to + // add the pipeline credential when run in CI. + class EventHubsManagement : Azure::Core::Test::TestBase { public: enum class EventHubsPricingTier { @@ -259,6 +262,8 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test { Azure::Core::Context const& context = {}); private: + // Dummy test body to satisfy Azure::Core::Test::TestBase. + void TestBody() {} std::string m_resourceGroup; std::string m_location; std::string m_subscriptionId; diff --git a/sdk/identity/azure-identity/samples/CMakeLists.txt b/sdk/identity/azure-identity/samples/CMakeLists.txt index 9eec6e9a6..d06601781 100644 --- a/sdk/identity/azure-identity/samples/CMakeLists.txt +++ b/sdk/identity/azure-identity/samples/CMakeLists.txt @@ -31,22 +31,22 @@ target_link_libraries(workload_identity_credential_sample PRIVATE azure-identity target_include_directories(workload_identity_credential_sample PRIVATE .) create_per_service_target_build_for_sample(identity workload_identity_credential_sample) -#add_executable(client_secret_credential_sample client_secret_credential.cpp) -#target_link_libraries(client_secret_credential_sample PRIVATE azure-identity service get-env-helper) -#target_include_directories(client_secret_credential_sample PRIVATE .) -#create_per_service_target_build_for_sample(identity client_secret_credential_sample) +add_executable(client_secret_credential_sample client_secret_credential.cpp) +target_link_libraries(client_secret_credential_sample PRIVATE azure-identity service get-env-helper) +target_include_directories(client_secret_credential_sample PRIVATE .) +create_per_service_target_build_for_sample(identity client_secret_credential_sample DISABLE_RUN) -#add_executable(default_azure_credential_sample default_azure_credential.cpp) -#target_link_libraries(default_azure_credential_sample PRIVATE azure-identity service) -#target_include_directories(default_azure_credential_sample PRIVATE .) -#create_per_service_target_build_for_sample(identity default_azure_credential_sample) +add_executable(default_azure_credential_sample default_azure_credential.cpp) +target_link_libraries(default_azure_credential_sample PRIVATE azure-identity service) +target_include_directories(default_azure_credential_sample PRIVATE .) +create_per_service_target_build_for_sample(identity default_azure_credential_sample DISABLE_RUN) -#add_executable(environment_credential_sample environment_credential.cpp) -#target_link_libraries(environment_credential_sample PRIVATE azure-identity service) -#target_include_directories(environment_credential_sample PRIVATE .) -#create_per_service_target_build_for_sample(identity environment_credential_sample) +add_executable(environment_credential_sample environment_credential.cpp) +target_link_libraries(environment_credential_sample PRIVATE azure-identity service) +target_include_directories(environment_credential_sample PRIVATE .) +create_per_service_target_build_for_sample(identity environment_credential_sample DISABLE_RUN) -#add_executable(managed_identity_credential_sample managed_identity_credential.cpp) -#target_link_libraries(managed_identity_credential_sample PRIVATE azure-identity service) -#target_include_directories(managed_identity_credential_sample PRIVATE .) -#create_per_service_target_build_for_sample(identity managed_identity_credential_sample) +add_executable(managed_identity_credential_sample managed_identity_credential.cpp) +target_link_libraries(managed_identity_credential_sample PRIVATE azure-identity service) +target_include_directories(managed_identity_credential_sample PRIVATE .) +create_per_service_target_build_for_sample(identity managed_identity_credential_sample DISABLE_RUN) diff --git a/sdk/keyvault/azure-security-keyvault-certificates/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-certificates/CMakeLists.txt index 9099e2852..b6883613d 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-certificates/CMakeLists.txt @@ -117,7 +117,7 @@ if (BUILD_PERFORMANCE_TESTS) add_subdirectory(test/perf) endif() -if(BUILD_SAMPLES_DISABLED) +if(BUILD_SAMPLES) add_subdirectory(samples) endif() diff --git a/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-basic-operations/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-basic-operations/CMakeLists.txt index 0ea0c4ff1..26642a66c 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-basic-operations/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-basic-operations/CMakeLists.txt @@ -12,6 +12,6 @@ add_executable ( certificate_basic_operations.cpp ) -create_per_service_target_build_for_sample(keyvault certificate-basic-operations) +create_per_service_target_build_for_sample(keyvault certificate-basic-operations DISABLE_RUN) target_link_libraries(certificate-basic-operations PRIVATE azure-security-keyvault-certificates azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-get-certificates/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-get-certificates/CMakeLists.txt index a74603b25..6a3513856 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-get-certificates/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-get-certificates/CMakeLists.txt @@ -11,6 +11,6 @@ add_executable ( certificate-get-certificates certificate_get_certificates.cpp ) -create_per_service_target_build_for_sample(keyvault certificate-get-certificates) +create_per_service_target_build_for_sample(keyvault certificate-get-certificates DISABLE_RUN) target_link_libraries(certificate-get-certificates PRIVATE azure-security-keyvault-certificates azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-import-certificate/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-import-certificate/CMakeLists.txt index e8083c38f..640aa4468 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-import-certificate/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-import-certificate/CMakeLists.txt @@ -11,6 +11,6 @@ add_executable ( certificate-import-certificate certificate_import_certificate.cpp ) -create_per_service_target_build_for_sample(keyvault certificate-import-certificate) +create_per_service_target_build_for_sample(keyvault certificate-import-certificate DISABLE_RUN) target_link_libraries(certificate-import-certificate PRIVATE azure-security-keyvault-certificates azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-keys/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-keys/CMakeLists.txt index e15956e35..9a18bee07 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-keys/CMakeLists.txt @@ -154,7 +154,7 @@ if (BUILD_PERFORMANCE_TESTS) add_subdirectory(test/perf) endif() -if(BUILD_SAMPLES_DISABLED) +if(BUILD_SAMPLES) add_subdirectory(samples) endif() diff --git a/sdk/keyvault/azure-security-keyvault-keys/samples/sample1-hello-world/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-keys/samples/sample1-hello-world/CMakeLists.txt index 0548eb0ba..d8d67c7b9 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/samples/sample1-hello-world/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-keys/samples/sample1-hello-world/CMakeLists.txt @@ -12,6 +12,6 @@ add_executable ( sample1_hello_world.cpp ) -create_per_service_target_build_for_sample(keyvault sample1-hello-world) +create_per_service_target_build_for_sample(keyvault sample1-hello-world DISABLE_RUN) target_link_libraries(sample1-hello-world PRIVATE azure-security-keyvault-keys azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-keys/samples/sample2-backup-and-restore/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-keys/samples/sample2-backup-and-restore/CMakeLists.txt index b8aedc677..d857a781c 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/samples/sample2-backup-and-restore/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-keys/samples/sample2-backup-and-restore/CMakeLists.txt @@ -11,6 +11,6 @@ add_executable ( sample2-backup-and-restore sample2_backup_and_restore.cpp ) -create_per_service_target_build_for_sample(keyvault sample2-backup-and-restore) +create_per_service_target_build_for_sample(keyvault sample2-backup-and-restore DISABLE_RUN) target_link_libraries(sample2-backup-and-restore PRIVATE azure-security-keyvault-keys azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-keys/samples/sample3-get-keys/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-keys/samples/sample3-get-keys/CMakeLists.txt index 43101d3de..a2a68d609 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/samples/sample3-get-keys/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-keys/samples/sample3-get-keys/CMakeLists.txt @@ -11,6 +11,6 @@ add_executable ( sample3-get-keys sample3_get_keys.cpp ) -create_per_service_target_build_for_sample(keyvault sample3-get-keys) +create_per_service_target_build_for_sample(keyvault sample3-get-keys DISABLE_RUN) target_link_libraries(sample3-get-keys PRIVATE azure-security-keyvault-keys azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-keys/samples/sample4-encrypt-decrypt/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-keys/samples/sample4-encrypt-decrypt/CMakeLists.txt index dc2b69a2e..ddda08eb8 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/samples/sample4-encrypt-decrypt/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-keys/samples/sample4-encrypt-decrypt/CMakeLists.txt @@ -11,6 +11,6 @@ add_executable ( sample4-encrypt-decrypt sample4_encrypt_decrypt.cpp ) -create_per_service_target_build_for_sample(keyvault sample4-encrypt-decrypt) +create_per_service_target_build_for_sample(keyvault sample4-encrypt-decrypt DISABLE_RUN) target_link_libraries(sample4-encrypt-decrypt PRIVATE azure-security-keyvault-keys azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-keys/samples/sample5-sign-verify/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-keys/samples/sample5-sign-verify/CMakeLists.txt index d6e0f1692..d6cd3fd9f 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/samples/sample5-sign-verify/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-keys/samples/sample5-sign-verify/CMakeLists.txt @@ -11,6 +11,6 @@ add_executable ( sample5-sign-verify sample5_sign_verify.cpp ) -create_per_service_target_build_for_sample(keyvault sample5-sign-verify) +create_per_service_target_build_for_sample(keyvault sample5-sign-verify DISABLE_RUN) target_link_libraries(sample5-sign-verify PRIVATE azure-security-keyvault-keys azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-keys/samples/sample6-wrap-unwrap/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-keys/samples/sample6-wrap-unwrap/CMakeLists.txt index bcc25a329..2c76defda 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/samples/sample6-wrap-unwrap/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-keys/samples/sample6-wrap-unwrap/CMakeLists.txt @@ -11,6 +11,6 @@ add_executable ( sample6-wrap-unwrap sample6_wrap_unwrap.cpp ) -create_per_service_target_build_for_sample(keyvault sample6-wrap-unwrap) +create_per_service_target_build_for_sample(keyvault sample6-wrap-unwrap DISABLE_RUN) target_link_libraries(sample6-wrap-unwrap PRIVATE azure-security-keyvault-keys azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-keys/samples/sample7-key-rotation/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-keys/samples/sample7-key-rotation/CMakeLists.txt index b0943ce00..5a9deb321 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/samples/sample7-key-rotation/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-keys/samples/sample7-key-rotation/CMakeLists.txt @@ -11,6 +11,6 @@ add_executable ( sample7-key-rotation sample7_key_rotation.cpp ) -create_per_service_target_build_for_sample(keyvault sample7-key-rotation) +create_per_service_target_build_for_sample(keyvault sample7-key-rotation DISABLE_RUN) target_link_libraries(sample7-key-rotation PRIVATE azure-security-keyvault-keys azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-secrets/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-secrets/CMakeLists.txt index f6521b342..56b5e0a89 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-secrets/CMakeLists.txt @@ -117,7 +117,7 @@ if (BUILD_PERFORMANCE_TESTS) add_subdirectory(test/perf) endif() -if(BUILD_SAMPLES_DISABLED) +if(BUILD_SAMPLES) add_subdirectory(samples) endif() diff --git a/sdk/keyvault/azure-security-keyvault-secrets/samples/sample1-basic-operations/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-secrets/samples/sample1-basic-operations/CMakeLists.txt index 0ac186bb0..d23d4029e 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/samples/sample1-basic-operations/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-secrets/samples/sample1-basic-operations/CMakeLists.txt @@ -11,6 +11,6 @@ add_executable ( sample1-basic-operations sample1_basic_operations.cpp ) -create_per_service_target_build_for_sample(keyvault sample1-basic-operations) +create_per_service_target_build_for_sample(keyvault sample1-basic-operations DISABLE_RUN) target_link_libraries(sample1-basic-operations PRIVATE azure-security-keyvault-secrets azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-secrets/samples/sample2-backup-restore/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-secrets/samples/sample2-backup-restore/CMakeLists.txt index 8e72238cc..8f9fd1a96 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/samples/sample2-backup-restore/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-secrets/samples/sample2-backup-restore/CMakeLists.txt @@ -12,6 +12,6 @@ add_executable ( sample2_backup_restore.cpp ) -create_per_service_target_build_for_sample(keyvault sample2-backup-restore) +create_per_service_target_build_for_sample(keyvault sample2-backup-restore DISABLE_RUN) target_link_libraries(sample2-backup-restore PRIVATE azure-security-keyvault-secrets azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-secrets/samples/sample3-delete-recover/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-secrets/samples/sample3-delete-recover/CMakeLists.txt index cb8ee9b46..d2e1da56a 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/samples/sample3-delete-recover/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-secrets/samples/sample3-delete-recover/CMakeLists.txt @@ -12,6 +12,6 @@ add_executable ( sample3_delete_recover.cpp ) -create_per_service_target_build_for_sample(keyvault sample3-delete-recover) +create_per_service_target_build_for_sample(keyvault sample3-delete-recover DISABLE_RUN) target_link_libraries(sample3-delete-recover PRIVATE azure-security-keyvault-secrets azure-identity get-env-helper) diff --git a/sdk/keyvault/azure-security-keyvault-secrets/samples/sample4-get-secrets-deleted/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-secrets/samples/sample4-get-secrets-deleted/CMakeLists.txt index 39f38beb5..004a9d7f3 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/samples/sample4-get-secrets-deleted/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-secrets/samples/sample4-get-secrets-deleted/CMakeLists.txt @@ -12,6 +12,6 @@ add_executable ( sample4_get_secrets_deleted.cpp ) -create_per_service_target_build_for_sample(keyvault sample4-get-secrets-deleted) +create_per_service_target_build_for_sample(keyvault sample4-get-secrets-deleted DISABLE_RUN) target_link_libraries(sample4-get-secrets-deleted PRIVATE azure-security-keyvault-secrets azure-identity get-env-helper)