Jun 26 2023
12:45 PM
- last edited on
Mar 05 2024
02:49 PM
by
TechCommunityAP
Jun 26 2023
12:45 PM
- last edited on
Mar 05 2024
02:49 PM
by
TechCommunityAP
I have the following sample code that I implement using Azure DevOps pipelines and it works without problem, I can see the value of the SAUCE variable in all the tasks in my Job. Then I run it but using a self hosted Agent that I have in an Azure virtual machine and it doesn't work anymore, for some reason the value of the variable is lost.
- job: TestOutputVars
displayName: Test Output Variables
steps:
- bash: |
echo "##vso[task.setvariable variable=sauce;isOutput=true]crushed tomatoes"
echo "my environment variable is $SAUCE"
- bash: |
echo "my environment variable is $SAUCE"
- task: PowerShell@2
inputs:
targetType: "inline"
script: |
Write-Host "my environment variable is $env:SAUCE"
pwsh: true
What could be the problem, or should I do some specific configuration in the virtual machine I am using as agent ?