Azure-devops-docs: Set a multi-job output variable does not work for deployments

Created on 20 Jul 2019  Â·  14Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

Deployment is a kind of job but the Set a multi-job output variable example does not work with a deployment.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 devops-cictech devopprod doc-bug

Most helpful comment

Hi @MisinformedDNA! Indeed, my comment does sound condescending and I am very sorry for this. I should have been more careful with my choice of words. I never meant to talk down on you nor on anyone else who seeks information. I am in no way more knowledgeable than anyone else.
I apologize. Even had I been right about the solution, I should not have remarked on anyone's attention.

All 14 comments

I also tried to set up a deployment job multi job variable and cloud not get it to work. The variable is empty, but exists in the second job.
@YvonneArnoldus do you have an information that this is not supported or did you not figure out a way to archive this?

@StefanSchoof,

I reproduced the given example with deployment instead of job and could not echo the variable in the second deployment.

azure-pipelines.yml

trigger:
- none

jobs:
# Set an output variable from job A
- deployment: A
  pool:
    vmImage: 'ubuntu-latest'
  environment: 'test'
  strategy:
    runOnce:
      deploy:
        steps:
        - powershell: echo "##vso[task.setvariable variable=myOutputVar;isOutput=true]this is the value"
          name: setvarStep
        - script: echo $(setvarStep.myOutputVar)
          name: echovar

# Map the variable into job B
- deployment: B
  dependsOn: A
  pool:
    vmImage: 'ubuntu-latest'
  variables:
    myVarFromJobA: $[ dependencies.A.outputs['setvarStep.myOutputVar'] ]  # map in the variable remember, expressions require single quotes
  environment: 'test'
  strategy:
    runOnce:
      deploy:
        steps:
        - script: echo $(myVarFromJobA)
          name: echovar

output echo $(myVarFromJobA) step in deployment B:

Starting: echovar
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.151.2
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
echo
========================== Starting Command Output ===========================
in/bash --noprofile --norc /home/vsts/work/_temp/f083f517-7e21-414c-b0f5-590ef5f09949.sh

Finishing: echovar

As you can see it the echo is empty, while the example with the jobs

trigger:
- none

jobs:

# Set an output variable from job A
- job: A
  pool:
    vmImage: 'vs2017-win2016'
  steps:
  - powershell: echo "##vso[task.setvariable variable=myOutputVar;isOutput=true]this is the value"
    name: setvarStep
  - script: echo $(setvarStep.myOutputVar)
    name: echovar

# Map the variable into job B
- job: B
  dependsOn: A
  pool:
    vmImage: 'ubuntu-16.04'
  variables:
    myVarFromJobA: $[ dependencies.A.outputs['setvarStep.myOutputVar'] ]  # map in the variable
                                                                          # remember, expressions require single quotes
  steps:
  - script: echo $(myVarFromJobA)
    name: echovar

output echo $(myVarFromJobA) step in deployment B:

Starting: echovar
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.151.2
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
echo this is the value
========================== Starting Command Output ===========================
in/bash --noprofile --norc /home/vsts/work/_temp/d992d271-ae42-4cce-a903-15e686cb89c1.sh
this is the value
Finishing: echovar

Which has 'this is the value' as echo.

So even do deployment is a job this example does not work with a deployment.

No idea why but I will not give me the same result with a deployment.

Thanks. For me it looks the same. I do a printenv and see the var but with no value. If someone has a tip or the secured information that this is not supported I would be thankful.

This is where I am at as well

Any update on this?
It's not possible to pass output variables from a deployment job to a subsequent job. Whether they're set in code or an output from a task. Example. URL from an App Service Deployment

also interested in this

According to this StackOverflow answer from Merlin Liang - MSFT, it doesn't look like multi-job output variables are supported for deployment jobs. If this is the case, the documentation should explicitly state this. I wasted all day trying to get this to work.

_EDIT: I would like to thank @MisinformedDNA for pointing out that my original message comes across as condescending (aside from the fact that the information itself is wrong). In the spirit of transparency, I am leaving it unchanged below. I apologize and I will try my best to be more mindful of the language I use._

Actually, what you are trying to do is supported. You just need to pay attention to the fact that deployments are using a strategy (runOnce), so the rules from the second part of Set a multi-job output variable apply. In this case it is not a matrix or slice, but it is the runOnce deployment strategy. However, all you need to do is reference your variable with the deploy prefix: setvarStep.myOutputVar -> deploy.setvarStep.myOutputVar:

myVarFromJobA: $[ dependencies.A.outputs['deploy.setvarStep.myOutputVar'] ]  # map in the variable

The deploy prefix comes from this bit of your pipeline:

- deployment: A
  pool:
    vmImage: 'ubuntu-latest'
  environment: 'test'
  strategy:
    runOnce:
      deploy:    # <--- here
        steps:

That's great to hear. I was actually going to try that next, until I read this issue and the previously mentioned StackOverflow answer. They both made it seem like it wasn't supported.

Clearly, there is enough confusion to warrant explicit documentation for this topic. So thank you @Victor-Savu for updating the documentation.

@Victor-Savu, did you test this? I ran the example in your pull request, and it doesn't work. I added the environment because this is required for a deployment job:

jobs:
  # Set an output variable from a deployment
  - deployment: A
    pool:
      vmImage: "ubuntu-16.04"
    environment: A
    strategy:
      runOnce:
        deploy:
          steps:
            - script: echo "##vso[task.setvariable variable=myOutputVar;isOutput=true]this is the deployment variable value"
              name: setvarStep
            - script: echo $(setvarStep.myOutputVar)
              name: echovar

  # Map the variable from the job for the first slice
  - job: B
    dependsOn: A
    pool:
      vmImage: "ubuntu-16.04"
    variables:
      myVarFromDeploymentJob: $[ dependencies.A.outputs['deploy.setvarStep.myOutputVar'] ]
    steps:
      - script: "echo $(myVarFromDeploymentJob)"
        name: echovar

See the following diagnostic logs:

Job A log:

2019-10-17T18:58:27.5136104Z ##[section]Starting: A
2019-10-17T18:58:27.5212815Z ##[debug]Cleaning agent temp folder: /home/vsts/work/_temp
2019-10-17T18:58:27.5300789Z ##[debug]Skipping overwrite %TEMP% environment variable
2019-10-17T18:58:27.7446100Z ##[section]Starting: Initialize job
2019-10-17T18:58:27.7446241Z Current agent version: '2.158.0'
2019-10-17T18:58:27.7532735Z ##[debug]Primary repository: P-PLM. repository type: Git
2019-10-17T18:58:27.7619826Z Prepare build directory.
2019-10-17T18:58:27.7850724Z ##[debug]Creating build directory: '/home/vsts/work/1'
2019-10-17T18:58:27.7851951Z ##[debug]Delete existing artifacts directory: '/home/vsts/work/1/a'
2019-10-17T18:58:27.7857123Z ##[debug]Creating artifacts directory: '/home/vsts/work/1/a'
2019-10-17T18:58:27.7858113Z ##[debug]Delete existing test results directory: '/home/vsts/work/1/TestResults'
2019-10-17T18:58:27.7858405Z ##[debug]Creating test results directory: '/home/vsts/work/1/TestResults'
2019-10-17T18:58:27.7859305Z ##[debug]Creating binaries directory: '/home/vsts/work/1/b'
2019-10-17T18:58:27.7860474Z ##[debug]Creating source directory: '/home/vsts/work/1/s'
2019-10-17T18:58:27.7861694Z Set build variables.
2019-10-17T18:58:27.7908829Z Download all required tasks.
2019-10-17T18:58:27.8073318Z Downloading task: CmdLine (2.151.2)
2019-10-17T18:58:28.0511774Z ##[debug]Task 'CmdLine' has been downloaded into '/home/vsts/work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/2.151.2'.
2019-10-17T18:58:28.1359024Z ##[debug]Log plugin 'TestResultLogPlugin' is disabled.
2019-10-17T18:58:28.1359135Z ##[debug]Log plugin 'TestFilePublisherPlugin' is disabled.
2019-10-17T18:58:28.1360012Z Start tracking orphan processes.
2019-10-17T18:58:28.1491049Z ##[section]Finishing: Initialize job
2019-10-17T18:58:28.1654083Z ##[debug]Evaluating condition for step: 'setvarStep'
2019-10-17T18:58:28.1831661Z ##[debug]Evaluating: SucceededNode()
2019-10-17T18:58:28.1859519Z ##[debug]Evaluating SucceededNode:
2019-10-17T18:58:28.1973292Z ##[debug]=> True
2019-10-17T18:58:28.2005450Z ##[debug]Result: True
2019-10-17T18:58:28.2073899Z ##[section]Starting: setvarStep
2019-10-17T18:58:28.2344263Z ==============================================================================
2019-10-17T18:58:28.2344342Z Task         : Command line
2019-10-17T18:58:28.2344381Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2019-10-17T18:58:28.2344418Z Version      : 2.151.2
2019-10-17T18:58:28.2344472Z Author       : Microsoft Corporation
2019-10-17T18:58:28.2344509Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2019-10-17T18:58:28.2344544Z ==============================================================================
2019-10-17T18:58:30.5862021Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp
2019-10-17T18:58:30.5862657Z ##[debug]loading inputs and endpoints
2019-10-17T18:58:30.5862746Z ##[debug]loading INPUT_SCRIPT
2019-10-17T18:58:30.5862813Z ##[debug]loading INPUT_WORKINGDIRECTORY
2019-10-17T18:58:30.5862929Z ##[debug]loading INPUT_FAILONSTDERR
2019-10-17T18:58:30.5863032Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2019-10-17T18:58:30.5863148Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2019-10-17T18:58:30.5863220Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2019-10-17T18:58:30.5863333Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2019-10-17T18:58:30.5863398Z ##[debug]loaded 7
2019-10-17T18:58:30.5863461Z ##[debug]Agent.ProxyUrl=undefined
2019-10-17T18:58:30.5863592Z ##[debug]Agent.CAInfo=undefined
2019-10-17T18:58:30.5863656Z ##[debug]Agent.ClientCert=undefined
2019-10-17T18:58:30.5863765Z ##[debug]Agent.SkipCertValidation=undefined
2019-10-17T18:58:30.5887060Z ##[debug]check path : /home/vsts/work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/2.151.2/task.json
2019-10-17T18:58:30.5887479Z ##[debug]adding resource file: /home/vsts/work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/2.151.2/task.json
2019-10-17T18:58:30.5887715Z ##[debug]system.culture=en-US
2019-10-17T18:58:30.5888145Z ##[debug]failOnStderr=false
2019-10-17T18:58:30.5888280Z ##[debug]script=echo "##vso[task.setvariable variable=myOutputVar;isOutput=true]this is the deployment variable value"
2019-10-17T18:58:30.5888346Z ##[debug]workingDirectory=/home/vsts/work/1/s
2019-10-17T18:58:30.5888460Z ##[debug]check path : /home/vsts/work/1/s
2019-10-17T18:58:30.5888536Z Generating script.
2019-10-17T18:58:30.5888601Z ##[debug]Agent.Version=2.158.0
2019-10-17T18:58:30.5888718Z ##[debug]agent.tempDirectory=/home/vsts/work/_temp
2019-10-17T18:58:30.5888782Z ##[debug]check path : /home/vsts/work/_temp
2019-10-17T18:58:30.5888821Z ========================== Starting Command Output ===========================
2019-10-17T18:58:30.5889152Z ##[debug]which 'bash'
2019-10-17T18:58:30.5889345Z ##[debug]found: '/bin/bash'
2019-10-17T18:58:30.5889581Z ##[debug]which 'bash'
2019-10-17T18:58:30.5889769Z ##[debug]found: '/bin/bash'
2019-10-17T18:58:30.5889941Z ##[debug]which '/bin/bash'
2019-10-17T18:58:30.5891293Z ##[debug]found: '/bin/bash'
2019-10-17T18:58:30.5891504Z ##[debug]which '/bin/bash'
2019-10-17T18:58:30.5892068Z ##[debug]found: '/bin/bash'
2019-10-17T18:58:30.5892256Z ##[debug]/bin/bash arg: --noprofile
2019-10-17T18:58:30.5892482Z ##[debug]/bin/bash arg: --norc
2019-10-17T18:58:30.5892679Z ##[debug]/bin/bash arg: /home/vsts/work/_temp/25573c5b-e445-4b74-9f18-9c16ac657560.sh
2019-10-17T18:58:30.5892750Z ##[debug]exec tool: /bin/bash
2019-10-17T18:58:30.5892866Z ##[debug]arguments:
2019-10-17T18:58:30.5893047Z ##[debug]   --noprofile
2019-10-17T18:58:30.5893268Z ##[debug]   --norc
2019-10-17T18:58:30.5893455Z ##[debug]   /home/vsts/work/_temp/25573c5b-e445-4b74-9f18-9c16ac657560.sh
2019-10-17T18:58:30.5893929Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/25573c5b-e445-4b74-9f18-9c16ac657560.sh
2019-10-17T18:58:30.5918949Z ##[debug]Processed: ##vso[task.setvariable variable=myOutputVar;isOutput=true]this is the deployment variable value
2019-10-17T18:58:30.5919471Z ##[debug]Exit code 0 received from tool '/bin/bash'
2019-10-17T18:58:30.5919738Z ##[debug]STDIO streams have closed for tool '/bin/bash'
2019-10-17T18:58:30.5919875Z ##[debug]task result: Succeeded
2019-10-17T18:58:30.5945728Z ##[debug]Processed: ##vso[task.complete result=Succeeded;done=true;]
2019-10-17T18:58:30.6018462Z ##[section]Finishing: setvarStep
2019-10-17T18:58:30.6034514Z ##[debug]Evaluating condition for step: 'echovar'
2019-10-17T18:58:30.6035725Z ##[debug]Evaluating: SucceededNode()
2019-10-17T18:58:30.6035921Z ##[debug]Evaluating SucceededNode:
2019-10-17T18:58:30.6036315Z ##[debug]=> True
2019-10-17T18:58:30.6036614Z ##[debug]Result: True
2019-10-17T18:58:30.6036886Z ##[section]Starting: echovar
2019-10-17T18:58:30.6039918Z ==============================================================================
2019-10-17T18:58:30.6039966Z Task         : Command line
2019-10-17T18:58:30.6039999Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2019-10-17T18:58:30.6040290Z Version      : 2.151.2
2019-10-17T18:58:30.6040430Z Author       : Microsoft Corporation
2019-10-17T18:58:30.6040462Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2019-10-17T18:58:30.6040493Z ==============================================================================
2019-10-17T18:58:30.7636212Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp
2019-10-17T18:58:30.7636513Z ##[debug]loading inputs and endpoints
2019-10-17T18:58:30.7636830Z ##[debug]loading INPUT_SCRIPT
2019-10-17T18:58:30.7636993Z ##[debug]loading INPUT_WORKINGDIRECTORY
2019-10-17T18:58:30.7637097Z ##[debug]loading INPUT_FAILONSTDERR
2019-10-17T18:58:30.7637203Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2019-10-17T18:58:30.7637343Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2019-10-17T18:58:30.7637441Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2019-10-17T18:58:30.7637560Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2019-10-17T18:58:30.7637786Z ##[debug]loaded 7
2019-10-17T18:58:30.7638385Z ##[debug]Agent.ProxyUrl=undefined
2019-10-17T18:58:30.7638490Z ##[debug]Agent.CAInfo=undefined
2019-10-17T18:58:30.7638625Z ##[debug]Agent.ClientCert=undefined
2019-10-17T18:58:30.7638715Z ##[debug]Agent.SkipCertValidation=undefined
2019-10-17T18:58:30.7639542Z ##[debug]check path : /home/vsts/work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/2.151.2/task.json
2019-10-17T18:58:30.7640070Z ##[debug]adding resource file: /home/vsts/work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/2.151.2/task.json
2019-10-17T18:58:30.7640979Z ##[debug]system.culture=en-US
2019-10-17T18:58:30.7641263Z ##[debug]failOnStderr=false
2019-10-17T18:58:30.7641434Z ##[debug]script=echo this is the deployment variable value
2019-10-17T18:58:30.7641502Z ##[debug]workingDirectory=/home/vsts/work/1/s
2019-10-17T18:58:30.7641766Z ##[debug]check path : /home/vsts/work/1/s
2019-10-17T18:58:30.7641808Z Generating script.
2019-10-17T18:58:30.7641909Z ##[debug]Agent.Version=2.158.0
2019-10-17T18:58:30.7642038Z ##[debug]agent.tempDirectory=/home/vsts/work/_temp
2019-10-17T18:58:30.7642247Z ##[debug]check path : /home/vsts/work/_temp
2019-10-17T18:58:30.7642463Z Script contents:
2019-10-17T18:58:30.7642560Z echo this is the deployment variable value
2019-10-17T18:58:30.7642757Z ========================== Starting Command Output ===========================
2019-10-17T18:58:30.7643156Z ##[debug]which 'bash'
2019-10-17T18:58:30.7643689Z ##[debug]found: '/bin/bash'
2019-10-17T18:58:30.7644133Z ##[debug]which 'bash'
2019-10-17T18:58:30.7644633Z ##[debug]found: '/bin/bash'
2019-10-17T18:58:30.7645068Z ##[debug]which '/bin/bash'
2019-10-17T18:58:30.7645556Z ##[debug]found: '/bin/bash'
2019-10-17T18:58:30.7645983Z ##[debug]which '/bin/bash'
2019-10-17T18:58:30.7646511Z ##[debug]found: '/bin/bash'
2019-10-17T18:58:30.7646942Z ##[debug]/bin/bash arg: --noprofile
2019-10-17T18:58:30.7647444Z ##[debug]/bin/bash arg: --norc
2019-10-17T18:58:30.7647880Z ##[debug]/bin/bash arg: /home/vsts/work/_temp/c7db721e-c062-4c2d-ad60-bcf08eb10e59.sh
2019-10-17T18:58:30.7648226Z ##[debug]exec tool: /bin/bash
2019-10-17T18:58:30.7648328Z ##[debug]arguments:
2019-10-17T18:58:30.7648647Z ##[debug]   --noprofile
2019-10-17T18:58:30.7648843Z ##[debug]   --norc
2019-10-17T18:58:30.7649498Z ##[debug]   /home/vsts/work/_temp/c7db721e-c062-4c2d-ad60-bcf08eb10e59.sh
2019-10-17T18:58:30.7650751Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/c7db721e-c062-4c2d-ad60-bcf08eb10e59.sh
2019-10-17T18:58:30.7651019Z this is the deployment variable value
2019-10-17T18:58:30.7651542Z ##[debug]Exit code 0 received from tool '/bin/bash'
2019-10-17T18:58:30.7652016Z ##[debug]STDIO streams have closed for tool '/bin/bash'
2019-10-17T18:58:30.7652341Z ##[debug]task result: Succeeded
2019-10-17T18:58:30.7653272Z ##[debug]Processed: ##vso[task.complete result=Succeeded;done=true;]
2019-10-17T18:58:30.7654462Z ##[section]Finishing: echovar
2019-10-17T18:58:30.7722397Z ##[section]Starting: Finalize Job
2019-10-17T18:58:30.7767124Z Start cleaning up orphan processes.
2019-10-17T18:58:30.7855012Z ##[section]Finishing: Finalize Job
2019-10-17T18:58:30.7921385Z ##[debug]Starting diagnostic file upload.
2019-10-17T18:58:30.7921481Z ##[debug]Setting up diagnostic log folders.
2019-10-17T18:58:30.7923678Z ##[debug]Creating diagnostic log files folder.
2019-10-17T18:58:30.7924103Z ##[debug]Creating diagnostic log environment file.
2019-10-17T18:58:30.7994813Z ##[debug]Creating capabilities file.
2019-10-17T18:58:30.8037377Z ##[debug]Copying 1 worker diag logs.
2019-10-17T18:58:30.8060778Z ##[debug]Copying 1 agent diag logs.
2019-10-17T18:58:30.8062182Z ##[debug]Zipping diagnostic files.
2019-10-17T18:58:30.8093805Z ##[debug]Uploading diagnostic metadata file.
2019-10-17T18:58:30.8143773Z ##[debug]Diagnostic file upload complete.
2019-10-17T18:58:30.8201689Z ##[section]Finishing: A

Job B log:

2019-10-17T18:58:55.9630322Z ##[section]Starting: B
2019-10-17T18:58:55.9698963Z ##[debug]Cleaning agent temp folder: /home/vsts/work/_temp
2019-10-17T18:58:55.9739951Z ##[debug]Skipping overwrite %TEMP% environment variable
2019-10-17T18:58:56.2903198Z ##[section]Starting: Initialize job
2019-10-17T18:58:56.2903307Z Current agent version: '2.158.0'
2019-10-17T18:58:56.2987834Z ##[debug]Primary repository: P-PLM. repository type: Git
2019-10-17T18:58:56.3079841Z Prepare build directory.
2019-10-17T18:58:56.3309965Z ##[debug]Creating build directory: '/home/vsts/work/1'
2019-10-17T18:58:56.3311257Z ##[debug]Delete existing artifacts directory: '/home/vsts/work/1/a'
2019-10-17T18:58:56.3317062Z ##[debug]Creating artifacts directory: '/home/vsts/work/1/a'
2019-10-17T18:58:56.3318098Z ##[debug]Delete existing test results directory: '/home/vsts/work/1/TestResults'
2019-10-17T18:58:56.3318354Z ##[debug]Creating test results directory: '/home/vsts/work/1/TestResults'
2019-10-17T18:58:56.3319155Z ##[debug]Creating binaries directory: '/home/vsts/work/1/b'
2019-10-17T18:58:56.3319955Z ##[debug]Creating source directory: '/home/vsts/work/1/s'
2019-10-17T18:58:56.3320919Z Set build variables.
2019-10-17T18:58:56.3364729Z Download all required tasks.
2019-10-17T18:58:56.3518053Z Downloading task: CmdLine (2.151.2)
2019-10-17T18:58:56.6592290Z ##[debug]Task 'CmdLine' has been downloaded into '/home/vsts/work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/2.151.2'.
2019-10-17T18:58:56.7433039Z ##[debug]Log plugin 'TestResultLogPlugin' is disabled.
2019-10-17T18:58:56.7433105Z ##[debug]Log plugin 'TestFilePublisherPlugin' is disabled.
2019-10-17T18:58:56.7433875Z Start tracking orphan processes.
2019-10-17T18:58:56.7563658Z ##[section]Finishing: Initialize job
2019-10-17T18:59:00.8716188Z ##[debug]Evaluating condition for step: 'echovar'
2019-10-17T18:59:00.8717119Z ##[debug]Evaluating: SucceededNode()
2019-10-17T18:59:00.8717237Z ##[debug]Evaluating SucceededNode:
2019-10-17T18:59:00.8717731Z ##[debug]=> True
2019-10-17T18:59:00.8718179Z ##[debug]Result: True
2019-10-17T18:59:00.8718389Z ##[section]Starting: echovar
2019-10-17T18:59:00.8720437Z ==============================================================================
2019-10-17T18:59:00.8720478Z Task         : Command line
2019-10-17T18:59:00.8720511Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2019-10-17T18:59:00.8720548Z Version      : 2.151.2
2019-10-17T18:59:00.8720579Z Author       : Microsoft Corporation
2019-10-17T18:59:00.8720610Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2019-10-17T18:59:00.8720647Z ==============================================================================
2019-10-17T18:59:02.9652504Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp
2019-10-17T18:59:02.9674261Z ##[debug]loading inputs and endpoints
2019-10-17T18:59:02.9678802Z ##[debug]loading INPUT_SCRIPT
2019-10-17T18:59:02.9689396Z ##[debug]loading INPUT_WORKINGDIRECTORY
2019-10-17T18:59:02.9691278Z ##[debug]loading INPUT_FAILONSTDERR
2019-10-17T18:59:02.9692259Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2019-10-17T18:59:02.9693330Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2019-10-17T18:59:02.9694056Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2019-10-17T18:59:02.9699754Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2019-10-17T18:59:02.9700446Z ##[debug]loaded 7
2019-10-17T18:59:02.9713538Z ##[debug]Agent.ProxyUrl=undefined
2019-10-17T18:59:02.9714139Z ##[debug]Agent.CAInfo=undefined
2019-10-17T18:59:02.9714861Z ##[debug]Agent.ClientCert=undefined
2019-10-17T18:59:02.9715235Z ##[debug]Agent.SkipCertValidation=undefined
2019-10-17T18:59:02.9727683Z ##[debug]check path : /home/vsts/work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/2.151.2/task.json
2019-10-17T18:59:02.9728810Z ##[debug]adding resource file: /home/vsts/work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/2.151.2/task.json
2019-10-17T18:59:02.9729442Z ##[debug]system.culture=en-US
2019-10-17T18:59:02.9745663Z ##[debug]failOnStderr=false
2019-10-17T18:59:02.9748835Z ##[debug]script=echo
2019-10-17T18:59:02.9750728Z ##[debug]workingDirectory=/home/vsts/work/1/s
2019-10-17T18:59:02.9751127Z ##[debug]check path : /home/vsts/work/1/s
2019-10-17T18:59:02.9784444Z Generating script.
2019-10-17T18:59:02.9785247Z ##[debug]Agent.Version=2.158.0
2019-10-17T18:59:02.9785655Z ##[debug]agent.tempDirectory=/home/vsts/work/_temp
2019-10-17T18:59:02.9785901Z ##[debug]check path : /home/vsts/work/_temp
2019-10-17T18:59:02.9804580Z Script contents:
2019-10-17T18:59:02.9804880Z echo
2019-10-17T18:59:02.9805032Z ========================== Starting Command Output ===========================
2019-10-17T18:59:02.9808130Z ##[debug]which 'bash'
2019-10-17T18:59:02.9815216Z ##[debug]found: '/bin/bash'
2019-10-17T18:59:02.9815771Z ##[debug]which 'bash'
2019-10-17T18:59:02.9816272Z ##[debug]found: '/bin/bash'
2019-10-17T18:59:02.9818115Z ##[debug]which '/bin/bash'
2019-10-17T18:59:02.9818547Z ##[debug]found: '/bin/bash'
2019-10-17T18:59:02.9818966Z ##[debug]which '/bin/bash'
2019-10-17T18:59:02.9819302Z ##[debug]found: '/bin/bash'
2019-10-17T18:59:02.9821941Z ##[debug]/bin/bash arg: --noprofile
2019-10-17T18:59:02.9822493Z ##[debug]/bin/bash arg: --norc
2019-10-17T18:59:02.9823221Z ##[debug]/bin/bash arg: /home/vsts/work/_temp/2e6d0dfc-5215-49d5-a2a4-d3eb07c31ed8.sh
2019-10-17T18:59:02.9829629Z ##[debug]exec tool: /bin/bash
2019-10-17T18:59:02.9830014Z ##[debug]arguments:
2019-10-17T18:59:02.9830546Z ##[debug]   --noprofile
2019-10-17T18:59:02.9831043Z ##[debug]   --norc
2019-10-17T18:59:02.9831450Z ##[debug]   /home/vsts/work/_temp/2e6d0dfc-5215-49d5-a2a4-d3eb07c31ed8.sh
2019-10-17T18:59:02.9836220Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/2e6d0dfc-5215-49d5-a2a4-d3eb07c31ed8.sh
2019-10-17T18:59:03.0040613Z 
2019-10-17T18:59:03.0056361Z ##[debug]Exit code 0 received from tool '/bin/bash'
2019-10-17T18:59:03.0066490Z ##[debug]STDIO streams have closed for tool '/bin/bash'
2019-10-17T18:59:03.0081620Z ##[debug]task result: Succeeded
2019-10-17T18:59:03.0102450Z ##[debug]Processed: ##vso[task.complete result=Succeeded;done=true;]
2019-10-17T18:59:03.0232757Z ##[section]Finishing: echovar
2019-10-17T18:59:03.4416346Z ##[section]Starting: Finalize Job
2019-10-17T18:59:03.4459566Z Start cleaning up orphan processes.
2019-10-17T18:59:03.4545211Z ##[section]Finishing: Finalize Job
2019-10-17T18:59:03.4601387Z ##[debug]Starting diagnostic file upload.
2019-10-17T18:59:03.4601449Z ##[debug]Setting up diagnostic log folders.
2019-10-17T18:59:03.4602630Z ##[debug]Creating diagnostic log files folder.
2019-10-17T18:59:03.4602952Z ##[debug]Creating diagnostic log environment file.
2019-10-17T18:59:03.4664343Z ##[debug]Creating capabilities file.
2019-10-17T18:59:03.4699980Z ##[debug]Copying 1 worker diag logs.
2019-10-17T18:59:03.4717676Z ##[debug]Copying 1 agent diag logs.
2019-10-17T18:59:03.4718925Z ##[debug]Zipping diagnostic files.
2019-10-17T18:59:03.4754120Z ##[debug]Uploading diagnostic metadata file.
2019-10-17T18:59:03.4809919Z ##[debug]Diagnostic file upload complete.
2019-10-17T18:59:03.4866045Z ##[section]Finishing: B

Hi @Slooz ! Thanks a lot for picking up on this! There is indeed a bug in my explanation: it is the name of the job that becomes the prefix, not "deploy".

So in your case it should be:

myVarFromDeploymentJob: $[ dependencies.A.outputs['A.setvarStep.myOutputVar'] ]

I will update the docs.
Thank you!

@Victor-Savu Awesome, I just tested it with your updated explanation and it works perfectly! Thank you! This method allows me to use a variable from one deployment job in another deployment job.

You just need to pay attention to the fact

@Victor-Savu Maybe next time, don't talk down to us (and then get it wrong).

Hi @MisinformedDNA! Indeed, my comment does sound condescending and I am very sorry for this. I should have been more careful with my choice of words. I never meant to talk down on you nor on anyone else who seeks information. I am in no way more knowledgeable than anyone else.
I apologize. Even had I been right about the solution, I should not have remarked on anyone's attention.

Was this page helpful?
0 / 5 - 0 ratings