File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,22 @@ jobs:
173173 - checkout : self
174174 clean : true
175175
176+ # https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-security-configuration/configuration-guides/pat-burndown-guidance#authentication-from-pipelines
177+ # Requires Azure client 2.x
178+ - task : AzureCLI@2
179+ displayName : ' Set AzDO.OneLocBuildToken'
180+ enabled : true
181+ inputs :
182+ azureSubscription : ' VSEng-AzureDevOps-ceapex-OneLocBuild' # Azure DevOps service connection
183+ scriptType : ' pscore'
184+ scriptLocation : ' inlineScript'
185+ inlineScript : |
186+ # if this fails, check out this bash script that includes diagnostics:
187+ # https://gist.github.com/johnterickson/19f80a3e969e39f1000d118739176e62
188+ # Note that the resource is specified to limit the token to Azure DevOps
189+ $token = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
190+ Write-Host "##vso[task.setvariable variable=AzDO.OneLocBuildToken;issecret=true]${token}"
191+
176192 - task : OneLocBuild@2
177193 displayName : OneLocBuild
178194 env :
@@ -181,7 +197,7 @@ jobs:
181197 locProj : Localize/LocProject.json
182198 outDir : $(Build.StagingDirectory)
183199 packageSourceAuth : patAuth
184- patVariable : $(OneLocBuild--PAT )
200+ patVariable : $(AzDO.OneLocBuildToken )
185201 isCreatePrSelected : true
186202 repoType : gitHub
187203 gitHubPatVariable : $(github--pat--vs-mobiletools-engineering-service2)
You can’t perform that action at this time.
0 commit comments