I'd like to use a parameter to enable the pipeline to switch between running on dedicated agents or an azure host by switching between
pool: name: Default
and
pool: vmImage: 'ubuntu-latest'
parameters:
- name: custom_agent
displayName: Use Custom Agent
type: boolean
default: true
pool:
${{ if eq(parameters.custom_agent, True) }}:
name: ${{ parameters.agent_pool }}
${{ if eq(parameters.custom_agent, False) }}:
vmImage: 'ubuntu-latest'
I've tried various variations but keep getting the error 'A template expression is not allowed in this context'
Am i missing something?, feels like this shouldn't be that hard.