I am trying to parameterize the agent.name in azure pipeline. The objective is to give the user the option to deploy the code in the desired machine. So I have created a pool with a few machines in it and parameterize the agent.name
Code
parameters
- name: machinename
displayName: machinename
type: string
values:
- 10.72.1.123
- 10.72.1.124
pool:
name: PoolA
demands:
- agent.name -equals ${{ parameters.machinename}}
Error : When trying to run the above code , I get the below error.
A template expression is not allowed in this context
Please help in resolving this issue.