I want include a template depending on the variable Agent.OS:
...
steps:
- ${{ if eq(variables['Agent.OS'], 'Linux') }}:
- template: /templates/prepare-tool.yaml
But this does not work. I don't see this step on the list of steps. I tried also:
- ${{ if eq(variables.AGENT_OS, 'Linux') }}:
The same result.
Maybe I'm wrong, but:
The difference between runtime and compile time expression syntaxes is primarily what context is available. In a compile-time expression (${{ }}), you have access to parameters and statically defined variables. In a runtime expression ($[ ]), you have access to more variables but no parameters.
So, I have to use - $[ if eq(...
for this variable, which is not static, but it does not work either:
Unexpected value '$[ if eq(variables.
I don't have idea how to use this kind of variable.
From what I found on stackoverflow(eg. 1, 2) this is impossible.