Skip to content

Commit e4a393a

Browse files
authored
Refactor DevDiv Drop Access Token retrieval
Updated the DevDiv drop access token retrieval process to use Azure CLI for acquiring the token.
1 parent 1562f86 commit e4a393a

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

azure-pipelines-official.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ variables:
9393

9494
# Group gives access to $dn-bot-devdiv-drop-rw-code-rw and dn-bot-dnceng-build-rw-code-rw
9595
- group: DotNet-VSTS-Infra-Access
96+
# DevDiv drop access token is acquired via WIF service connection (dnceng-devdiv-drop-rw-code-rw-wif)
9697
- name: _DevDivDropAccessToken
97-
value: $(dn-bot-devdiv-drop-rw-code-rw)
98+
value: ''
9899
- name: _SignType
99100
value: real
100101
- name: _SignArgs
@@ -333,6 +334,16 @@ extends:
333334

334335
# Publishes setup VSIXes to a drop.
335336
# Note: The insertion tool looks for the display name of this task in the logs.
337+
- task: AzureCLI@2
338+
displayName: Get DevDiv Drop Access Token
339+
inputs:
340+
azureSubscription: 'dnceng-devdiv-drop-rw-code-rw-wif'
341+
scriptType: pscore
342+
scriptLocation: inlineScript
343+
inlineScript: |
344+
$token = az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv
345+
Write-Host "##vso[task.setvariable variable=_DevDivDropAccessToken;issecret=true]$token"
346+
condition: succeeded()
336347
- task: 1ES.MicroBuildVstsDrop@1
337348
displayName: Upload VSTS Drop
338349
inputs:

0 commit comments

Comments
 (0)