Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cmake-modules/AzureBuildTargetForCI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endmacro()
# Adds a target to be built and also run during a CI run
# - param service: The Azure SDK service group
# - param target: The name of the cmake target to be built
macro(create_per_service_target_build_for_sample service target)
macro(create_per_service_target_build_for_sample service target run_sample)
Comment thread
LarryOsterman marked this conversation as resolved.
Outdated

# Create the built target
create_per_service_target_build(${service} ${target})
Expand All @@ -32,6 +32,8 @@ 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")


if (${run_sample})
file(APPEND ${CMAKE_BINARY_DIR}/${service}-samples.txt "${CMAKE_CURRENT_BINARY_DIR}/${binary}\n")
endif()
endmacro()
2 changes: 1 addition & 1 deletion samples/integration/vcpkg-all-smoke/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ target_link_libraries(vcpkg-all-smoke
get-env-helper
)

create_per_service_target_build_for_sample(keyvault vcpkg-all-smoke)
create_per_service_target_build_for_sample(keyvault vcpkg-all-smoke TRUE)
Original file line number Diff line number Diff line change
Expand Up @@ -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} FALSE)

target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation get-env-helper)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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} FALSE)

target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation azure-identity get-env-helper)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 FALSE)

target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation azure-identity OpenSSL::Crypto get-env-helper)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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} FALSE)

target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation azure-identity get-env-helper)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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} FALSE)

target_link_libraries(eventhubs-${samplename} PRIVATE azure-messaging-eventhubs azure-identity)
endmacro()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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} FALSE)

target_link_libraries(eventhubs-${samplename} PRIVATE azure-messaging-eventhubs azure-identity)
endmacro()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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} FALSE)

target_link_libraries(eventhubs-${samplename} PRIVATE azure-messaging-eventhubs azure-identity)
endmacro()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <azure/core/internal/json/json.hpp>
#include <azure/core/platform.hpp>
#include <azure/core/response.hpp>
#include <azure/identity/default_azure_credential.hpp>

#include <memory>
#include <sstream>
Expand All @@ -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<Azure::Core::Http::Policies::_internal::BearerTokenAuthenticationPolicy>(
std::make_unique<Azure::Identity::DefaultAzureCredential>(), tokenContext));
GetTestCredential(), tokenContext));
}
std::vector<std::unique_ptr<Azure::Core::Http::Policies::HttpPolicy>> perCallpolicies;
options.Telemetry.ApplicationId = "eventhubs.test";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
#include <azure/core/internal/http/pipeline.hpp>
#include <azure/core/internal/json/json.hpp>
#include <azure/core/operation.hpp>
#include <azure/core/test/test_base.hpp>

#include <string>
#include <vector>

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
{
Expand Down Expand Up @@ -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;
Expand Down
48 changes: 24 additions & 24 deletions sdk/identity/azure-identity/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,39 @@ 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 .)
create_per_service_target_build_for_sample(identity azure_cli_credential_sample)
create_per_service_target_build_for_sample(identity azure_cli_credential_sample TRUE)

add_executable(chained_token_credential_sample chained_token_credential.cpp)
target_link_libraries(chained_token_credential_sample PRIVATE azure-identity service)
target_include_directories(chained_token_credential_sample PRIVATE .)
create_per_service_target_build_for_sample(identity chained_token_credential_sample)
create_per_service_target_build_for_sample(identity chained_token_credential_sample TRUE)

add_executable(client_certificate_credential_sample client_certificate_credential.cpp)
target_link_libraries(client_certificate_credential_sample PRIVATE azure-identity service get-env-helper)
target_include_directories(client_certificate_credential_sample PRIVATE .)
create_per_service_target_build_for_sample(identity client_certificate_credential_sample)
create_per_service_target_build_for_sample(identity client_certificate_credential_sample TRUE)

add_executable(workload_identity_credential_sample workload_identity_credential.cpp)
target_link_libraries(workload_identity_credential_sample PRIVATE azure-identity service get-env-helper)
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(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(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(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)
create_per_service_target_build_for_sample(identity workload_identity_credential_sample TRUE)

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 FALSE)

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 FALSE)

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 FALSE)

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 FALSE)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ add_executable (
macros_build.cpp
macros_build.hpp)

create_per_service_target_build_for_sample(keyvault macros-build)
create_per_service_target_build_for_sample(keyvault macros-build TRUE)

target_link_libraries(macros-build PRIVATE azure-security-keyvault-keys)
10 changes: 5 additions & 5 deletions sdk/storage/azure-storage-blobs/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ 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)
create_per_service_target_build_for_sample(storage blob-getting-started TRUE)

add_executable(blob-list-operation blob_list_operation.cpp)
target_link_libraries(blob-list-operation PRIVATE azure-storage-blobs get-env-helper)
create_per_service_target_build_for_sample(storage blob-list-operation)
create_per_service_target_build_for_sample(storage blob-list-operation TRUE)

add_executable(blob-sas blob_sas.cpp)
target_link_libraries(blob-sas PRIVATE azure-storage-blobs get-env-helper)
create_per_service_target_build_for_sample(storage blob-sas)
create_per_service_target_build_for_sample(storage blob-sas TRUE)

add_executable(transactional-checksum transactional_checksum.cpp)
target_link_libraries(transactional-checksum PRIVATE azure-storage-blobs get-env-helper)
create_per_service_target_build_for_sample(storage transactional-checksum)
create_per_service_target_build_for_sample(storage transactional-checksum TRUE)

add_executable(blob-query blob_query.cpp)
target_link_libraries(blob-query PRIVATE azure-storage-blobs get-env-helper)
create_per_service_target_build_for_sample(storage blob-query)
create_per_service_target_build_for_sample(storage blob-query TRUE)
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ if(MSVC)
endif()

add_executable(datalake-getting-started datalake_getting_started.cpp)
create_per_service_target_build_for_sample(storage datalake-getting-started)
create_per_service_target_build_for_sample(storage datalake-getting-started TRUE)
target_link_libraries(datalake-getting-started PRIVATE azure-storage-files-datalake get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ if(MSVC)
endif()

add_executable(file-share-getting-started file_share_getting_started.cpp)
create_per_service_target_build_for_sample(storage file-share-getting-started)
create_per_service_target_build_for_sample(storage file-share-getting-started TRUE)
target_link_libraries(file-share-getting-started PRIVATE azure-storage-files-shares get-env-helper)
4 changes: 2 additions & 2 deletions sdk/storage/azure-storage-queues/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ 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)
create_per_service_target_build_for_sample(storage queue-getting-started TRUE)

add_executable(queue-encode-message queue_encode_message.cpp)
target_link_libraries(queue-encode-message PRIVATE azure-storage-queues get-env-helper)
create_per_service_target_build_for_sample(storage queue-encode-message)
create_per_service_target_build_for_sample(storage queue-encode-message TRUE)
10 changes: 5 additions & 5 deletions sdk/tables/azure-data-tables/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ endif()

add_executable(tables-getting-started tables_getting_started.cpp )
target_link_libraries(tables-getting-started PRIVATE azure-data-tables get-env-helper)
create_per_service_target_build_for_sample(tables tables-getting-started)
create_per_service_target_build_for_sample(tables tables-getting-started TRUE)

add_executable(tables_entity_operations tables_entity_operations.cpp)
target_link_libraries(tables_entity_operations PRIVATE azure-data-tables get-env-helper)
create_per_service_target_build_for_sample(tables tables_entity_operations)
create_per_service_target_build_for_sample(tables tables_entity_operations TRUE)

add_executable(tables_service_operations tables_service_operations.cpp)
target_link_libraries(tables_service_operations PRIVATE azure-data-tables get-env-helper)
create_per_service_target_build_for_sample(tables tables_service_operations)
create_per_service_target_build_for_sample(tables tables_service_operations TRUE)

add_executable(tables_transactions_ok tables_transactions_ok.cpp)
target_link_libraries(tables_transactions_ok PRIVATE azure-data-tables get-env-helper)
create_per_service_target_build_for_sample(tables tables_transactions_ok)
create_per_service_target_build_for_sample(tables tables_transactions_ok TRUE)

add_executable(tables_transactions_fail tables_transactions_fail.cpp)
target_link_libraries(tables_transactions_fail PRIVATE azure-data-tables get-env-helper)
create_per_service_target_build_for_sample(tables tables_transactions_fail)
create_per_service_target_build_for_sample(tables tables_transactions_fail TRUE)