I know that in Azure DevOps, variables accessed like $(varname) are runtime only. But I'm struggling to understand why my code below doesn't work when I am accessing it using the compile time syntax
This is a shortened down version on my pipeline. Basically, I have the main pipeline file, then each environment (dev, etc) will have it's own .yml. This is just for organizational purposes. Each environment file will call a set of stages
azure-pipeline.yml
variables:
- name: myVar
value: 'one'
stages:
# Deploy Dev
- template: ./azure-pipeline-dev.yml
azure-pipeline-dev.yml
stages:
- template: ./deploy.yml
parameters:
myParam: ${{ variables.myVar }}
deploy.yml
parameters:
- name: myParam
type: string
values:
- one
- two
When I do this I get an error saying:
/azure-pipeline-dev.yml The 'myParam' parameter value '' is not a valid value.
But my question is, since I am using the compile time syntax, why is the value not being loaded into the ${{ variables.myVar }}

