Skip to content

Commit

Permalink
pr-fix: add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnmoreels committed Jul 25, 2024
1 parent d607f53 commit d4daa9e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions build/templates/import-keyvault-secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

0 comments on commit d4daa9e

Please sign in to comment.