Skip to content

Commit c2ae332

Browse files
authored
Update OneLocBuildToken (#141)
* Update OneLocBuildToken * Force loc task pool image to windows
1 parent 4fef46a commit c2ae332

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

azure-pipelines.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,10 @@ extends:
343343
jobs:
344344
- job: OneLocBuild
345345
displayName: OneLocBuild
346-
pool: $(MicroBuildPoolName)
346+
pool:
347+
name: AzurePipelines-EO
348+
demands:
349+
- ImageOverride -equals 1ESPT-Windows2022
347350
timeoutInMinutes: 30
348351
variables:
349352
- group: Xamarin-Secrets
@@ -360,6 +363,22 @@ extends:
360363
- checkout: self
361364
clean: true
362365

366+
# 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
367+
# Requires Azure client 2.x
368+
- task: AzureCLI@2
369+
displayName: 'Set AzDO.OneLocBuildToken'
370+
enabled: true
371+
inputs:
372+
azureSubscription: 'VSEng-AzureDevOps-ceapex-OneLocBuild' # Azure DevOps service connection
373+
scriptType: 'pscore'
374+
scriptLocation: 'inlineScript'
375+
inlineScript: |
376+
# if this fails, check out this bash script that includes diagnostics:
377+
# https://gist.github.com/johnterickson/19f80a3e969e39f1000d118739176e62
378+
# Note that the resource is specified to limit the token to Azure DevOps
379+
$token = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
380+
Write-Host "##vso[task.setvariable variable=AzDO.OneLocBuildToken;issecret=true]${token}"
381+
363382
- task: OneLocBuild@2
364383
displayName: OneLocBuild
365384
env:
@@ -368,7 +387,7 @@ extends:
368387
locProj: Localize/LocProject.json
369388
outDir: $(Build.StagingDirectory)
370389
packageSourceAuth: patAuth
371-
patVariable: $(OneLocBuild--PAT)
390+
patVariable: $(AzDO.OneLocBuildToken)
372391
isCreatePrSelected: true
373392
repoType: gitHub
374393
gitHubPatVariable: $(github--pat--vs-mobiletools-engineering-service2)

0 commit comments

Comments
 (0)