Vcpkg sample (#3670)
* one commit to rule them all * main merge * error * all smoke * typo * 120 minutes * timeout param missing on job * actual url * Update samples/integration/vcpkg-all-smoke/src/main.cpp Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com> * actual creds Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com>
This commit is contained in:
parent
a401ac937a
commit
855f000f63
@ -19,7 +19,7 @@ parameters:
|
||||
default: sdk/*/*/*cov_xml.xml
|
||||
- name: TimeoutInMinutes
|
||||
type: number
|
||||
default: 60
|
||||
default: 120
|
||||
- name: DependsOn
|
||||
type: string
|
||||
default: ''
|
||||
@ -41,7 +41,7 @@ jobs:
|
||||
- job: ValidateLive
|
||||
dependsOn: ${{ parameters.DependsOn }}
|
||||
condition: ne(${{ parameters.Matrix }}, '{}')
|
||||
|
||||
timeoutInMinutes: ${{ parameters.TimeoutInMinutes }}
|
||||
pool:
|
||||
name: $(Pool)
|
||||
vmImage: $(OSVmImage)
|
||||
|
||||
@ -25,7 +25,7 @@ parameters:
|
||||
default: 'sdk/*/*/*cov_xml.xml'
|
||||
- name: LiveTestTimeoutInMinutes
|
||||
type: number
|
||||
default: 90
|
||||
default: 120
|
||||
- name: LineCoverageTarget
|
||||
type: number
|
||||
default: 95
|
||||
|
||||
@ -13,7 +13,7 @@ parameters:
|
||||
default: sdk/*/*/*cov_xml.xml
|
||||
- name: TimeoutInMinutes
|
||||
type: number
|
||||
default: 60
|
||||
default: 120
|
||||
- name: Location
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
#include "get_env.hpp"
|
||||
#include <azure/attestation.hpp>
|
||||
#include <azure/core.hpp>
|
||||
#include <azure/core/internal/json/json.hpp>
|
||||
#include <azure/identity.hpp>
|
||||
#include <azure/keyvault/certificates.hpp>
|
||||
#include <azure/keyvault/keys.hpp>
|
||||
@ -30,11 +31,15 @@ using namespace Azure::Security::Attestation;
|
||||
|
||||
int main()
|
||||
{
|
||||
const std::string tenantId = "tenant";
|
||||
const std::string clientId = "client";
|
||||
const std::string clientSecret = "secret";
|
||||
auto tenantId = std::getenv("AZURE_TENANT_ID");
|
||||
auto clientId = std::getenv("AZURE_CLIENT_ID");
|
||||
auto clientSecret = std::getenv("AZURE_CLIENT_SECRET");
|
||||
const std::string leaseID = "leaseID";
|
||||
const std::string smokeUrl = "https://blob.com";
|
||||
// Creating an attestation service instance requires contacting the attestation service (to retrieve validation collateral).
|
||||
// Use the West US Shared client (which should always be available) as an anonymous service instance.
|
||||
const std::string attestationUrl = "https://sharedwus.wus.attest.azure.net";
|
||||
|
||||
auto credential
|
||||
= std::make_shared<Azure::Identity::ClientSecretCredential>(tenantId, clientId, clientSecret);
|
||||
|
||||
@ -43,9 +48,9 @@ int main()
|
||||
{
|
||||
std::cout << "Creating Keyvault Clients" << std::endl;
|
||||
// keyvault
|
||||
KeyClient keyClient(std::getenv("AZURE_KEYVAULT_URL"), credential);
|
||||
SecretClient secretClient(std::getenv("AZURE_KEYVAULT_URL"), credential);
|
||||
CertificateClient certificateClient(std::getenv("AZURE_KEYVAULT_URL"), credential);
|
||||
KeyClient keyClient(smokeUrl, credential);
|
||||
SecretClient secretClient(smokeUrl, credential);
|
||||
CertificateClient certificateClient(smokeUrl, credential);
|
||||
|
||||
std::cout << "Creating Storage Clients" << std::endl;
|
||||
// Storage
|
||||
@ -69,10 +74,12 @@ int main()
|
||||
|
||||
// Attestation
|
||||
std::cout << "Creating Attestation Clients" << std::endl;
|
||||
std::unique_ptr<AttestationClient> attestationClient(
|
||||
AttestationClientFactory::Create(std::getenv("ATTESTATION_AAD_URL")));
|
||||
|
||||
std::unique_ptr<AttestationAdministrationClient> attestationAdminClient(
|
||||
AttestationAdministrationClientFactory::Create(std::getenv("ATTESTATION_AAD_URL"), credential));
|
||||
AttestationAdministrationClientFactory::Create(attestationUrl, credential));
|
||||
|
||||
std::unique_ptr<AttestationClient> attestationClient(
|
||||
AttestationClientFactory::Create(attestationUrl));
|
||||
|
||||
std::cout << "Successfully Created the Clients" << std::endl;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user