My build script uses the SYSTEM_ACCESSTOKEN
environment variable.
In the designer build definition I checked Allow scripts to access the OAuth token
I found the solution in the Pipeline Variable docs: The variable must be declared in YAML.
At pipeline level for all jobs / tasks:
variables:
system_accesstoken: $(System.AccessToken)
jobs:
job: ...
Or at script / task level for example PowerShell:
- powershell: ./build.ps1
env:
system_accesstoken: $(System.AccessToken)