Skip to content

Commit 19b6be4

Browse files
greathongtuHongtu Zhang (FA Talent)
andauthored
use azpwsh to retrieve key vault secrets (#22065)
* use azpwsh to retrieve key vault secrets * use meaningful names --------- Co-authored-by: Hongtu Zhang (FA Talent) <[email protected]>
1 parent 28c1060 commit 19b6be4

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.azure-pipelines/sync-aliases.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,24 @@ jobs:
1010
- job: UpdateJson
1111
displayName: Update fabricbot.json
1212
steps:
13-
- task: AzureKeyVault@2
13+
- task: AzurePowerShell@5
1414
inputs:
1515
azureSubscription: 'Azure SDK Infrastructure'
16-
KeyVaultName: '$(KeyVaultName)'
17-
SecretsFilter: '$(ADOTokenName)'
18-
RunAsPreJob: false
16+
ScriptType: 'InlineScript'
17+
Inline: |
18+
$ADOTokenValue = Get-AzKeyVaultSecret -VaultName ${env:KEYVAULTNAME} -Name ${env:ADOTOKENNAME} -AsPlainText
19+
Write-Host "##vso[task.setvariable variable=ADOToken;issecret=true]$ADOTokenValue"
20+
azurePowerShellVersion: 'LatestVersion'
21+
displayName: Get ADOToken from Key Vault
1922

2023
- pwsh: |
21-
./tools/Github/ParseUncyclo2Json.ps1 -ADOToken $("$(ADOTokenName)")
24+
./tools/Github/ParseUncyclo2Json.ps1 -ADOToken $(ADOToken)
2225
displayName: Update fabricbot.json file locally
23-
26+
2427
- pwsh: |
2528
$gitStatus = git status -s
2629
if (-not $gitStatus) {
27-
Write-Host "The wiki has no changes ."
30+
Write-Host "The wiki has no changes."
2831
Write-Host "##vso[task.setvariable variable=ChangesDetected]false"
2932
} else {
3033
Write-Host "There are changes in the repository."

0 commit comments

Comments
 (0)