Azure DevOps Pipelines
Build and release with Azure Pipelines — stages, jobs, and environments.
Theory
Azure Pipelines (part of Azure DevOps) defines CI/CD in a YAML file
(azure-pipelines.yml). Its structure mirrors most systems:
- Trigger — what starts the pipeline (branch pushes, PRs)
- Stages → Jobs → Steps/Tasks — tasks are reusable building blocks
- Agents — run jobs (Microsoft-hosted or self-hosted agent pools)
- Environments — deployment targets with approvals and gates
- Service connections — authenticate to Azure/clouds; variable groups and Key Vault supply secrets
It integrates tightly with Azure (deploy to App Service/AKS) and provides approvals for controlled production releases.
Real-World Example
trigger:
branches: { include: [main] }
stages:
- stage: Build
jobs:
- job: build
pool: { vmImage: ubuntu-latest }
steps:
- script: npm ci && npm test
- stage: Deploy
dependsOn: Build
jobs:
- deployment: deployProd
environment: production # approvals attach here
strategy:
runOnce:
deploy:
steps:
- script: ./deploy.sh Hands-On Exercise
- Identify the stage → job → step hierarchy in a pipeline.
- Add a deploy stage that depends on a build stage.
- Explain how an Environment enables an approval gate before production.
- Describe how a variable group or Key Vault supplies secrets to a pipeline.
Cheat Sheet▾
| Concept | Detail |
|---|---|
| Trigger | Branch/PR that starts it |
| Stage / Job / Step | Pipeline hierarchy |
| Task | Reusable step building block |
| Agent pool | Where jobs run |
| Environment | Deploy target + approvals |
| Service connection | Auth to clouds |
| Variable group / Key Vault | Secrets/config |
Common Interview Questions▾
How are Azure Pipelines structured?
A trigger starts the pipeline; stages contain jobs, which contain steps/tasks. Jobs run on agents, and deployment jobs target environments that can require approvals.
How do you add a manual approval before production?
Attach approvals/checks to the production Environment; the deployment job pauses until an authorized approver allows it to proceed.
Official Documentation
📝 My notes on this topic
Auto-saves as you type