From d4daa9ed3bb7fda220b64a1e45b0187d4965d348 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Thu, 25 Jul 2024 08:15:31 +0200 Subject: [PATCH] pr-fix: add logging --- build/templates/import-keyvault-secrets.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/build/templates/import-keyvault-secrets.yml b/build/templates/import-keyvault-secrets.yml index d323178a..4a00a6bc 100644 --- a/build/templates/import-keyvault-secrets.yml +++ b/build/templates/import-keyvault-secrets.yml @@ -15,14 +15,12 @@ steps: $instrumentationKeySecretName = ${{ variables['ApplicationInsights.InstrumentationKey.SecretName'] }} $apiKeySecretName = ${{ variables['ApplicationInsights.ApiKey.SecretName'] }} $applicationIdSecretName = ${{ variables['ApplicationInsights.ApplicationId.SecretName'] }} - $secretNames = @( - $instrumentationKeySecretName, - $apiKeySecretName, - $applicationIdSecretName) + $secretNames = @( $instrumentationKeySecretName, $apiKeySecretName, $applicationIdSecretName ) $secretNames | ForEach-Object { $secretName = $_ - $secret = az keyvault secret show --name $secretName --vault-name ${{ variables['KeyVault.Name'] }} | ConvertFrom-Json - $variableName = $secretName -replace '-','.' + Write-Host "Importing Azure Key vault secret '$secretName' as Azure DevOps pipeline variable '$variableName'" + + $secret = az keyvault secret show --name $secretName --vault-name ${{ variables['KeyVault.Name'] }} | ConvertFrom-Json Set-AzDevOpsVariable $variableName -Value $secret.value -AsSecret } \ No newline at end of file