Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pr-fix: correct key vault secret name definitions
Browse files Browse the repository at this point in the history
stijnmoreels committed Jul 25, 2024
1 parent fb8a9fd commit 16bf488
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions build/templates/import-keyvault-secrets.yml
Original file line number Diff line number Diff line change
@@ -13,13 +13,13 @@ steps:
Install-Module -Name Arcus.Scripting.DevOps -AllowClobber
$secretNames = @(
'ApplicationInsights.InstrumentationKey.SecretName',
'ApplicationInsights.ApiKey.SecretName',
'ApplicationInsights.ApplicationId.SecretName')
${{ variables['ApplicationInsights.InstrumentationKey.SecretName'] }},
${{ variables['ApplicationInsights.ApiKey.SecretName'] }},
${{ variables['ApplicationInsights.ApplicationId.SecretName'] }})
$secretNames | ForEach-Object {
$secretName = $_
$secret = az keyvault secret show --name ${{ variables[$secretName] }} --vault-name ${{ variables['KeyVault.Name'] }} | ConvertFrom-Json
$secret = az keyvault secret show --name $secretName --vault-name ${{ variables['KeyVault.Name'] }} | ConvertFrom-Json
$variableName = $secretName -replace '\.SecretName$', ''
$variableName = $secretName -replace '-', '.'
Set-AzDevOpsVariable $variableName -Value $secret.value -AsSecret }

0 comments on commit 16bf488

Please sign in to comment.