Consider the following working job from an azure yaml pipeline
- job: create_slot
dependsOn: setup
displayName: 'Create slot'
pool:
vmImage: 'windows-latest'
variables:
slotName: $[ dependencies.setup.outputs['slot.name'] ]
steps:
- bash: |
echo "Slot to be created: $(slotName)"
displayName: 'Show slot name'
- template: templates/create-slot.yml
parameters:
slot: $(slotName)
From the documentation I would expect that I can replace the marco $(slotName)
directly with the runtime expression $[ dependencies.setup.outputs['slot.name'] ]
, which results in the following:
- job: create_slot
dependsOn: setup
displayName: 'Create slot'
pool:
vmImage: 'windows-latest'
steps:
- bash: |
echo "Slot to be created: $(slotName)"
displayName: 'Show slot name'
- template: templates/create-slot.yml
parameters:
slot: $[ dependencies.setup.outputs['slot.name'] ]
But if you do this, the pipeline fails
From the error I get the impression that $[ dependencies.setup.outputs['slot.name'] ]
is treaded as a string. Is it possible what I'm trying here, maybe I have incorrect syntax.
$[ dependencies.Job1.outputs['slot.name'] ]
in a variable assignment, like I did in my first code example. Because in my second example it is simply treated as a string, not as a variable. Does that make any sense? – Lasseter