AZ-400 ยท Pipeline foundations
Authoring YAML pipelines
Azure Pipelines YAML hierarchy (stages, jobs, steps, tasks, script), pool, conditions, expressions and runtime vs compile-time syntax; GitHub Actions workflow structure (jobs, steps, uses, run, needs, if, outputs).
Key points
- Azure Pipelines: stages > jobs > steps; a step is a task or script/bash/pwsh; pool picks the agent; condition gates.
- ${{ }} expands before the run, so it cannot see run-time values; $(var) and $[ ] resolve later.
- Each step is its own process; pass values with ##vso[task.setvariable].
- GitHub Actions: jobs have runs-on and steps; a step has uses or run; needs orders jobs, if gates them, outputs share values.
Source: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/runs?view=azure-devops
Practice questions
In an Azure Pipelines multi-stage YAML file, what is the correct nesting from outermost to innermost?
- stage, job, step
- job, stage, step
- step, job, stage
- pool, step, job
Show answer
Answer: A. stage, job, step
Stages contain jobs and jobs contain steps (tasks or scripts).
Which keys belong to GitHub Actions workflow syntax?
- uses
- run
- needs
- pool
- dependsOn
Show answer
Answer: A. uses, B. run, C. needs
uses runs a packaged action, run executes a shell command and needs orders jobs. pool and dependsOn are Azure Pipelines keywords.
In Azure Pipelines, an environment variable set by one script step is still available to the next step in the same job.
Show answer
Answer: False
False. Each step runs in its own process. Use the setvariable logging command to turn a value into a pipeline variable for later steps.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
