Skip to content

Commit 559a6d2

Browse files
authored
proxy-agent - get PAT (#4858)
1 parent e38036c commit 559a6d2

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.azure-pipelines/get-pat.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
steps:
2+
- task: AzureCLI@2
3+
inputs:
4+
azureSubscription: ARM - WIF - manual
5+
scriptType: pscore
6+
scriptLocation: inlineScript
7+
inlineScript: |
8+
az account set --subscription $(SUBSCRIPTION_ID)
9+
$accessToken = az account get-access-token --resource $(RESOURCE_ID) --query accessToken --output tsv
10+
echo "##vso[task.setvariable variable=ACCESS_TOKEN;issecret=true]$accessToken"
11+
displayName: Get Access Token

.azure-pipelines/pipeline.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ extends:
111111
nugetMultiFeedWarnLevel: none
112112
timeoutInMinutes: 300
113113
steps:
114+
- template: /.azure-pipelines/get-pat.yml@self
114115
- bash: |
115116
cd ./.azure-pipelines/scripts/
116117
npm install axios minimist
@@ -123,7 +124,7 @@ extends:
123124
node ./run-and-verify.js \
124125
--projectUrl "$(CANARY_PROJECT_URL)" \
125126
--pipelineId "$(CANARY_PIPELINE_ID)" \
126-
--token "$(CANARY_PAT)" \
127+
--token "$(ACCESS_TOKEN)" \
127128
--templateParameters "{ \"branch\": \"${branch}\" }"
128129
displayName: Test Proxy Agent
129130

0 commit comments

Comments
 (0)