Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure YAML Pipelines - Using template expression variables at non-global scope #593

Open
puya-ms opened this issue May 28, 2023 · 2 comments

Comments

@puya-ms
Copy link

puya-ms commented May 28, 2023

Using the template expression variable syntax for a job-scoped variable is resulting in it being resolved to empty string. It seems that the compiler is not able to find a replacement value:

Template variables silently coalesce to empty strings when a replacement value isn't found.

Is this expected behavior? I could not find any mention of this in the documentation. Code example:

# Global variables are correctly replaced
variables:
  globalVar1: hello

extends:
  template: template.yml
    stages:
    - stage: stage1
      jobs:
      - job: job1
        variables:
          localVar1: world
        steps:
        - task: DisplayString
          inputs:
            stringToDisplay: ${{ variables.globalVar1}} ${{ variables.localVar1}}
            # This shows "hello "

Furthermore I have not been able to use the ${{ var }} syntax with variable templates either.

@ivanduplenskikh
Copy link

Hi @puya-ms thanks for reporting! We are working on more prioritized issues at the moment, but will get back to this one soon.

@ahmed7am1d
Copy link

Still relevant...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants