Pipeline components and stage
MS Learn module: Pipeline components & stage · Learning objectives: decompose a CI pipeline into stages/jobs/steps/tasks, define ordering and dependencies between them, and feed each with the correct variables and secrets.
Overview
A pipeline is not one script — it is an orchestration graph of small, reusable components. Azure Pipelines and GitHub Actions both model work as stages → jobs → steps → tasks, where each layer has an ordering rule, a scope, and its own inputs. Master the components ladder plus how ordering and dependencies are declared, and you can express almost any CI workflow faithfully in YAML.
Units / lessons covered
- The ladder: pipeline → stages → jobs → steps/tasks (one atomic command/unit)
- Ordering: sibling jobs run in parallel; use dependencies to join them explicitly
- Dependencies: GitHub
needs:/run; Azure Pipelines job-leveldependsOn,always,on-failure - Variables & secrets: scoping,
$(var)/${{ }}expansion, secret masking,env:mapping - How a completed run is staged into later CD stages (see pipeline-run)
Concepts introduced (link to term notes)
Key terms / commands
- Azure Pipelines:
variables:·secrets:· “steps:/task:· job-leveldependsOn/always - GitHub Actions:
env:·secrets:·steps:·needs:·runs-on:· indexon.pull_request/pushgate
Hands-on / what to try
Author a 3-stage pipeline where build and lint run in parallel, test depends on both, and deploy runs last. Inject a build version number as a variable and a token as a secret; print both from a step to confirm scope and masking.
Exam focus
- A task is the atomic leaf that runs one command; a step may bundle several tasks; a job is the independent, relocatable unit.
- Stages represent major checkpoints (build → test → deploy); parallel jobs must join before a dependent stage.
- Ordering defaults to parallel across siblings; deps must be explicit — a frequent exam trap.
- Never embed secrets in YAML — use
secrets./${{ secrets }}and the secret-backed store (Key Vault).
Related
Path MOC · advanced-yaml-pipelines · pipeline-run-diagnostics-and-maintenance · set-up-ci-with-azure-pipelines
📘 Source: What is Azure Pipelines · Azure Pipelines variables