Using an Azure DevOps yaml pipeline, my variable expansion works if the variables are set in the root but not if they are set in the stage. Can anyone explain what I need to do to get the variable expansion to work with variables set in the stage?
#azure-pipelines.yml
# If I uncomment the lines below my variable expansion will work
# variables:
# - group: Foo
stages:
- stage: Bar
# If I uncomment the lines below my variable expansion will **not** work
# variables:
# - group: Foo
jobs:
- deployment:
# The expansion of $(environment) below...
# - works if the variables are set in the root
# - fails if the variables are set in the stage (error message: Environment $(environment) could not be found. )
environment: $(environment)