0

Trying to set up a hello world pipeline which echo's a variable I pass in. Need to trigger via API. I have the trigger working but I can't get my variable printing to the console.

I've defined a variable called myVar

ado image

Including the PAT conversion as it might save someone else the 3hrs it took me to track down the correct combo.

MY_PAT=abc1234
B64_PAT=$(printf "%s"":$MY_PAT" | base64)

curl -X POST https://dev.azure.com/***/test/_apis/pipelines/123/runs?api-version=6.0-preview.1 \
-H Authorization: Basic $64_PAT \
-H Content-Type: application-json
{
  "parameters": "{ \"myVar\": \"foo\" }"
}

My task is a command line script (task 2.*):

echo Hello world
echo $(myVar)
riQQ
  • 9,878
  • 7
  • 49
  • 66
john smith
  • 53
  • 3
  • https://stackoverflow.com/questions/66185420/azure-devops-rest-api-run-pipeline-with-variables. See the "with runs api". Confusing that there's two APIs but that syntax worked. – john smith Feb 09 '22 at 08:35
  • Hi john smith; if your question is about why the pipeline is not printing the variable, then the information about the API call is not relevant. – Vince Bowdren Feb 09 '22 at 18:48
  • What is relevant is your pipeline; can you paste in the yaml, for the task where you are expecting to print the variable out? – Vince Bowdren Feb 09 '22 at 18:49

0 Answers0