Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
096ea48
Enable KeyVault-Keys samples.
ahsonkhan Jul 15, 2024
a405f0a
Change the samples task from powershell to azure cli.
ahsonkhan Jul 15, 2024
e5a3100
Used global az cli config and add some commands for debugging.
ahsonkhan Jul 15, 2024
b89a97f
Remove az commands added for debugging.
ahsonkhan Jul 16, 2024
b43d622
Re-enable keyvault samples.
ahsonkhan Jul 16, 2024
4c754f7
Update az cli default timeout and run az upgrade command first.
ahsonkhan Jul 16, 2024
032c0fa
Use prompt-free upgrade command and add debugging to az cli.
ahsonkhan Jul 16, 2024
42be57b
Sleep after upgrade and run az login explicitly.
ahsonkhan Jul 16, 2024
f7eae0b
Use AzureCliCredential directly and add verbose logging.
ahsonkhan Jul 16, 2024
538b778
Get Access token after calling az account list and increase the default
ahsonkhan Jul 16, 2024
2e9666c
Add more az cli shell commands to AzureCliCredential to see when things
ahsonkhan Jul 16, 2024
f01c86e
Run az account list with debug and print the AZURE_CONFIG_DIR.
ahsonkhan Jul 16, 2024
4499352
Add azure_config_dir logging earlier.
ahsonkhan Jul 16, 2024
515186d
Remove az login command from AzureCliCredential.
ahsonkhan Jul 16, 2024
7dddfe9
Fix write-host by removing $ that isn't escaped.
ahsonkhan Jul 16, 2024
4f08756
Unset the env var Azure_Config_Dir to be consistent between
ahsonkhan Jul 16, 2024
3260918
Unset the azure_config_dir env var before the task starts.
ahsonkhan Jul 17, 2024
77de49e
Use a custom azure_config_dir path.
ahsonkhan Jul 17, 2024
61770ab
Only run the samples on Ubuntu, skipping them on Windows.
ahsonkhan Jul 17, 2024
77e560b
Revert "Only run the samples on Ubuntu, skipping them on Windows."
ahsonkhan Jul 17, 2024
76dfe0f
Keep azure_config_dir set.
ahsonkhan Jul 17, 2024
0fcddc9
Remove use of custom azure_config_dir.
ahsonkhan Jul 17, 2024
dcc09bf
Restore az cli cred files back to what's in main.
ahsonkhan Jul 18, 2024
56c88de
Set azure_config_dir to some default value.
ahsonkhan Jul 18, 2024
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
32 changes: 22 additions & 10 deletions eng/pipelines/templates/jobs/live.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,28 @@ jobs:
# Will run samples described on a file name [service]-samples.txt within the build directory.
# For example keyvault-samples.txt.
# The file is written by CMake during configuration when building samples.
- task: AzurePowerShell@5
displayName: "Run Samples for : ${{ parameters.ServiceDirectory }}"
- task: AzureCLI@2
displayName: "Run Samples with AzureCli for : ${{ parameters.ServiceDirectory }}"
condition: and(succeeded(), eq(variables['RunSamples'], '1'))
inputs:
azureSubscription: ${{ parameters.CloudConfig.ServiceConnection }}
azurePowerShellVersion: LatestVersion
ScriptType: InlineScript
Inline: |
$account = (Get-AzContext).Account
$env:AZURESUBSCRIPTION_CLIENT_ID = $account.Id
$env:AZURESUBSCRIPTION_TENANT_ID = $account.Tenants

scriptType: 'pscore'
scriptLocation: 'inlineScript'
inlineScript: |
Write-Host "Where is az CLI located"
(Get-Command az).Path
Write-Host "Check az CLI version"
az --version
Write-Host "Run az account show"
az account show
Write-Host "Run az account list --debug"
az account list --debug
Write-Host "Run az account get-access-token --output none --debug --verbose"
az account get-access-token --output none --debug --verbose
Write-Host "Run env:AZURE_CONFIG_DIR"
$env:AZURE_CONFIG_DIR
Write-Host "Run Get-ChildItem env:"
Get-ChildItem env:
if (Test-Path -Path "${{ parameters.ServiceDirectory }}-samples.txt") {
$samples = Get-Content "${{ parameters.ServiceDirectory }}-samples.txt"
foreach ($sample in $samples) {
Expand All @@ -269,9 +279,11 @@ jobs:
}
}
workingDirectory: build
useGlobalConfig: true
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
# SYSTEM_ACCESSTOKEN: $(System.AccessToken)
${{ insert }}: ${{ parameters.EnvVars }}
AZURE_CONFIG_DIR: 'D:\a\_work\_temp\.azclitask'

- ${{ else }}:
- bash: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if (BUILD_PERFORMANCE_TESTS)
add_subdirectory(test/perf)
endif()

if(BUILD_SAMPLES_DISABLED)
if(BUILD_SAMPLES)
add_subdirectory(samples)
endif()

Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/azure-security-keyvault-keys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ if (BUILD_PERFORMANCE_TESTS)
add_subdirectory(test/perf)
endif()

if(BUILD_SAMPLES_DISABLED)
if(BUILD_SAMPLES)
add_subdirectory(samples)
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using namespace Azure::Security::KeyVault::Keys;
int main()
{
auto const keyVaultUrl = std::getenv("AZURE_KEYVAULT_URL");
auto credential = std::make_shared<Azure::Identity::DefaultAzureCredential>();
auto credential = std::make_shared<Azure::Identity::AzureCliCredential>();

KeyClient keyClient(keyVaultUrl, credential);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if (BUILD_PERFORMANCE_TESTS)
add_subdirectory(test/perf)
endif()

if(BUILD_SAMPLES_DISABLED)
if(BUILD_SAMPLES)
add_subdirectory(samples)
endif()

Expand Down