---
title: "Discussion on \"Passing variables between jobs for Azure DevOps pipelines\" | Hashnode"
description: "Discussion on \"Passing variables between jobs for Azure DevOps pipelines\". Using Azure DevOps, you can create pipeline variables dynamically. Out of the box, most dynamic variables are scoped to the job. But, if you need to, you can reference pipeline variables defined in other jobs. For example, if you have a stage that ha..."
url: "https://hashnode.com/posts/passing-variables-between-jobs-for-azure-devops-pipelines/619d36f406cdc0324d91504b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Passing variables between jobs for Azure DevOps pipelines](https://gaunacode.com/passing-variables-between-jobs-for-azure-devops-pipelines?utm_source=hashnode&utm_medium=feed)

Using Azure DevOps, you can create pipeline variables dynamically. Out of the box, most dynamic variables are scoped to the job. But, if you need to, you can reference pipeline variables defined in other jobs. For example, if you have a stage that ha...

Mar 25, 2020 · 2 min read · gaunacode.com  
Updated Dec 22, 2021  
Read the article

-   [#devops](https://hashnode.com/tag/devops)

## Written by

[Facundo Gauna](https://hashnode.com/@gaunacode)

@gaunacode · Orlando, FL

  
[View profile](https://hashnode.com/@gaunacode)

Building cloud-native apps on Azure. I can't stop self-improving.

I used to be a .NET developer. Nowaways, I am a DevOps solutions architect with a focus on Azure and Kubernetes. I also love productivity topics, especially when it comes to doing more with less of my time. I'm also a daddy, so time is a limited resource for me.

## Responses 2

Markdown supported · ⌘↵ to post

[Maikel](https://hashnode.com/@maikel2)

[Dec 9, 2021](https://hashnode.com/posts/passing-variables-between-jobs-for-azure-devops-pipelines/619d36f406cdc0324d91504b/comment/61b221c01907c16be2ee094f)

Like [lavoizer](https://hashnode.com/@lavoizer) mentioned, the example does not work.

Fixed it for you:

```
variables:
  someName: someValue

stages:
- stage: stage_deploy
  displayName: Production
  jobs:
  - job: job_deploy_infrastructure
    displayName: Deploy Some Infrastructure
    steps:
    - bash: |
        SOMEVALUE="bleh"
        echo "##vso[task.setvariable variable=someName;isOutput=true;]$SOMEVALUE"
        echo "variable value is $(someName)"
      name: setVariable
  - job: job_deploy_code
    displayName: Deploy Some Code
    dependsOn: ['job_deploy_infrastructure']
    variables:
      someName: $[ dependencies.job_deploy_infrastructure.outputs['setVariable.someName'] ]
    steps:
    - bash: |
        echo "the variable value is $(someName)"
```

[Facundo Gauna](https://hashnode.com/@gaunacode)

[Dec 14, 2021](https://hashnode.com/posts/passing-variables-between-jobs-for-azure-devops-pipelines/619d36f406cdc0324d91504b/comment/61b221c01907c16be2ee094f#reply-61b7fd76d2a5c9036e6f012d)

Thanks for putting the time into this!

[Facundo Gauna](https://hashnode.com/@gaunacode)

[Dec 22, 2021](https://hashnode.com/posts/passing-variables-between-jobs-for-azure-devops-pipelines/619d36f406cdc0324d91504b/comment/61b221c01907c16be2ee094f#reply-61c3a1dfc0206b3f41f54c69)

Updated the blog post.

[Alessandro Surace](https://hashnode.com/@zioalex)

[Jun 9, 2022](https://hashnode.com/posts/passing-variables-between-jobs-for-azure-devops-pipelines/619d36f406cdc0324d91504b/comment/61b221c01907c16be2ee094f#reply-62a218706cc4647a1b005043)

[Facundo Gauna](https://hashnode.com/@gaunacode) nope! I do not see the update.

[lavoizer](https://hashnode.com/@lavoizer)

[Nov 29, 2021](https://hashnode.com/posts/passing-variables-between-jobs-for-azure-devops-pipelines/619d36f406cdc0324d91504b/comment/61a4ba4d9ac0d611876b1c91)

Hi,

This example isnt working anymore, when i echo the value nothing is displayed, I am stuck on a similar problem, maybe can you please assist? thx
