← Back to Portal
Quick Reference Cheatsheet
Everything you need to recall cold on exam day — YAML, strategies, secrets, SRE, KQL, and the 13-rule answer hierarchy.
Section 1 — Azure Pipelines YAML Structure
trigger:
branches:
include: [main, release/*]
pr:
branches:
include: [main]
pool:
vmImage: ubuntu-latest # Microsoft-hosted
# name: MyAgentPool # Self-hosted
variables:
- group: MyKeyVaultGroup # Variable group (Key Vault linked)
- name: buildConfiguration
value: Release
stages:
- stage: Build
jobs:
- job: BuildAndTest
steps:
- template: templates/build-steps.yml@SharedPipelines
parameters:
project: src/MyApp
- stage: Deploy_Staging
dependsOn: Build
jobs:
- deployment: Deploy
environment: staging
strategy:
runOnce:
deploy:
steps:
- script: echo "deploy"
Trigger Types
| Key | When it fires | Use for |
|---|---|---|
trigger: | Code pushed to branch | Main CI build → produce artefacts |
pr: | PR opened/updated targeting branch | Build validation gate before merge |
schedules: | Cron expression (UTC) | Nightly scans, weekly reports |
resources.pipelines: | Another pipeline completes | CD triggered by upstream CI |
Exam Trap
trigger: fires on push to a branch. pr: fires when a PR targets a branch. They are different events for different purposes.Section 2 — Template Types
| Template type | When to use | Example |
|---|---|---|
| Step template | Share a list of steps across multiple jobs | Security scans, test steps, publish steps |
| Job template | Share an entire job definition | Standard build job used by 10 services |
| Stage template | Share an entire deployment stage | Deploy-to-environment stage reused per env |
| Variable template | Share variable definitions | Common registry URL, image name prefix |
Cross-Repository Template Reference
resources:
repositories:
- repository: SharedPipelines
type: git
name: MyOrg/SharedPipelines
ref: refs/tags/v2.1.0 # Pin to a tag, not refs/heads/main
stages:
- template: templates/deploy-stage.yml@SharedPipelines
parameters:
environment: production
serviceConnection: prod-sc
Exam RulePin template references to a tag or commit SHA, not a branch, for stability. If the question asks how to prevent template changes from breaking consumers — tag pinning is the answer.
Section 3 — Agents
| Factor | Microsoft-Hosted | Self-Hosted |
|---|---|---|
| Private network access | No | Yes |
| Setup overhead | Zero | You manage |
| Custom pre-installed tools | No (install each run) | Yes |
| Ephemeral (fresh each run) | Yes | No (unless configured) |
| Cost | Free minutes + per-minute charge | Infrastructure cost |
Decision RulePrivate database / corporate firewall / on-premises endpoint → self-hosted. Standard open-source build → Microsoft-hosted.
Section 4 — Deployment Strategies
| Strategy | Rollback speed | Best for |
|---|---|---|
| Blue/Green | Instant (re-switch) | Critical services, instant rollback needed |
| Canary | Automatic on threshold breach | Gradual risk, data-driven release |
| Ring | Per-ring rollback | SaaS with distinct user populations |
| Rolling | Slow (redeploy) | Stateless services, backward-compatible changes |
| Feature Flag | Instant (flip flag) | Decouple deploy from release; A/B testing |
| Big Bang | Slow (full redeploy) | Avoid — highest blast radius |
Key Distinctions
"Instant rollback without redeployment" → Blue/Green (or Feature Flag)
"Gradual rollout with health-gate progression" → Canary
"Turn off feature without deploying" → Feature Flag
"Maintain v1, v2, v3 simultaneously" → NOT deployment strategy — this is GitFlow branching
"Gradual rollout with health-gate progression" → Canary
"Turn off feature without deploying" → Feature Flag
"Maintain v1, v2, v3 simultaneously" → NOT deployment strategy — this is GitFlow branching
Section 5 — Secret Management
The Correct Chain
# Pipeline route
Secret → Azure Key Vault → Variable Group (Key Vault linked)
→ Pipeline variable (masked) → App
# Application runtime route
Secret → Azure Key Vault → Managed Identity
→ Application code (runtime retrieval) → No credential in code
Key Vault + Pipeline Variable Groups
variables:
- group: ProductionSecrets # Variable group linked to Key Vault
steps:
- script: echo "$(DatabasePassword)" # Value masked in logs
Managed Identity (application runtime)
// No credential in code — identity authenticates automatically
var client = new SecretClient(
new Uri("https://myvault.vault.azure.net/"),
new DefaultAzureCredential() // Uses managed identity in Azure
);
var secret = await client.GetSecretAsync("DatabasePassword");
Key Vault Reference (App Service / Function)
@Microsoft.KeyVault(VaultName=myVault;SecretName=ConnectionString)
Wrong Patterns (Exam Traps)
| Wrong pattern | Why wrong |
|---|---|
| Store secret in YAML file | In source control — readable by anyone with repo access |
| Base64-encode secret in YAML | Base64 is encoding, not encryption — trivially reversed |
| Store in plain pipeline variable | Stored in Azure DevOps without Key Vault protection |
| Hardcode in source code | In history forever even after removal |
| Pass as command-line argument | Visible in process list and logs |
Section 6 — Security Scan Reference
| Scan type | Acronym | Requires running app | Earliest stage | Tools |
|---|---|---|---|---|
| Static Application Security Testing | SAST | No | PR validation | SonarQube, Checkmarx, GitHub SAST |
| Software Composition Analysis | SCA | No | PR validation | Mend, Snyk, OWASP Dependency-Check |
| Infrastructure as Code Scanning | IaC scan | No | PR validation | Checkov, tfsec, Azure Policy |
| Secret Scanning | — | No | Pre-commit hook | detect-secrets, gitleaks, GitHub secret scanning |
| Container Image Scanning | — | No | Before registry push | Trivy, Aqua, Defender for Containers |
| Dynamic Application Security Testing | DAST | Yes | Post-deploy to test env | OWASP ZAP, Burp Suite Enterprise |
Exam RuleSAST + SCA + IaC scan → PR validation build. DAST → deployed test environment. Critical CVE found = fail the pipeline immediately. Not warn, not quarantine.
Section 7 — Branching Strategies
| Factor | Trunk-Based | GitFlow |
|---|---|---|
| Main branch | Always deployable | Represents production |
| Feature branches | Very short-lived (hours to 2 days) | Can live for weeks |
| Release branches | Not required | release/x.x per release |
| Large features | Feature flags | Long-lived branches |
| Best for | High-frequency delivery, CI/CD | Versioned releases, multi-version support |
Decision Rule
"Deploys multiple times per day/week" → Trunk-based
"Maintains v1.x, v2.x, v3.x simultaneously" → GitFlow
"Teams want speed and CI but governance" → Trunk-based + strict PR policies
"Maintains v1.x, v2.x, v3.x simultaneously" → GitFlow
"Teams want speed and CI but governance" → Trunk-based + strict PR policies
Section 8 — Pull Request Policy Stack
| Policy | Setting | Why required |
|---|---|---|
| Minimum reviewer count | ≥ 2 (preferably) | Human code review |
| Build validation | Required (blocking) | Automated quality gate |
| Linked work items | Required | Traceability to requirements |
| Comment resolution | Required | Nothing unaddressed in review |
| No force push | Enforced | Immutable history |
| Delete source branch | Automatic on merge | Repository hygiene |
| CODEOWNERS / required reviewers | Configured per path | Ownership for sensitive files |
Section 9 — SRE Formulae and Definitions
SLI → what you measure (e.g., "request success rate")
SLO → what you target (e.g., "99.9% over 28 days")
SLA → what you promise (always ≤ SLO — never above)
Error Budget Calculation
Error budget = (1 − SLO) × measurement period
Examples:
99.0% SLO, 30 days → 0.010 × 43,200 min = 432 min (7.2 hours)
99.5% SLO, 30 days → 0.005 × 43,200 min = 216 min (3.6 hours)
99.9% SLO, 30 days → 0.001 × 43,200 min = 43 min
99.95% SLO, 30 days → 21.6 min
99.99% SLO, 30 days → 4.3 min
Burn Rate
Burn rate = current consumption rate / sustainable rate
Burn rate 1× → budget exhausted exactly at period end (normal)
Burn rate 2× → budget exhausted in half the period
Burn rate 6× → budget exhausted in 1/6th of the period (~5 days monthly)
High burn rate → freeze risky releases → prioritise reliability work
Low burn rate → safe to increase release velocity
DORA Metrics
| Metric | What it measures | Elite performer |
|---|---|---|
| Deployment frequency | How often deployed to production | Multiple per day |
| Lead time for changes | Commit → production | Less than 1 hour |
| MTTR | Incident detection → service restoration | Less than 1 hour |
| Change failure rate | % of deployments causing incidents | Less than 15% |
Toil Characteristics
Toil isManual + repetitive + triggered by service events + scales with service load + provides no enduring value. SRE target: ≤ 50% of time on toil. Toil above 50% must be actively reduced.
Section 10 — Azure Boards Reference
Work Item Hierarchy
Epic → Strategic initiative, spans quarters / multiple teams
└── Feature → Product capability, spans multiple sprints
└── User Story → User-facing increment, fits within one sprint
└── Task → Implementation step, estimated in hours
└── Bug → Defect, tracked as first-class work item
Process Templates
| Template | Work item types | Best for |
|---|---|---|
| Agile | Epic, Feature, User Story, Task, Bug, Issue | Most teams |
| Scrum | Epic, Feature, PBI, Task, Bug, Impediment | Strict Scrum teams |
| CMMI | Epic, Feature, Requirement, Task, Bug, Change Request | Regulated/CMMI process |
Work Item State Flow (Agile)
New → Active → Resolved → Closed
↓
(test fails) → Active
Section 11 — Scrum Ceremonies Reference
| Ceremony | Duration | Attendees | Output |
|---|---|---|---|
| Sprint Planning | 2 hr per sprint week | Dev + PO + SM | Sprint goal + sprint backlog |
| Daily Scrum | 15 min (strict) | Dev team | Coordination, blocker surfacing |
| Sprint Review | 1 hr per sprint week | Dev + PO + Stakeholders | Demo, backlog feedback, backlog update |
| Sprint Retrospective | 45–90 min | Dev + SM (no stakeholders) | 1–3 process improvement actions |
| Backlog Refinement | 1–2 hr per sprint | Dev + PO | Items estimated, acceptance criteria defined |
Most Common Exam TrapSprint Review = show stakeholders what was built, update backlog. Sprint Retrospective = internal team process improvement, no stakeholders. These are always tested.
Section 12 — KQL Reference
-- Filter rows
requests
| where resultCode == "500"
| where timestamp > ago(24h)
-- Count by status code
requests
| summarize count() by resultCode
| order by count_ desc
-- Average duration by hour
requests
| summarize avg(duration) by bin(timestamp, 1h)
-- 99th percentile latency
requests
| summarize percentile(duration, 99) by bin(timestamp, 1h)
-- Error rate as percentage
requests
| summarize
total = count(),
failures = countif(success == false)
by bin(timestamp, 1h)
| extend errorRate = (failures * 100.0) / total
-- Failed requests with details
requests
| where success == false
| project timestamp, name, resultCode, duration, url
| order by timestamp desc
| take 50
-- Join requests with exceptions
requests
| where success == false
| join kind=leftouter (exceptions | project operation_Id, type, outerMessage)
on operation_Id
| project timestamp, name, type, outerMessage
Key Fields in the requests Table
| Field | Type | Description |
|---|---|---|
timestamp | datetime | When the request was received |
resultCode | string | HTTP status code as string |
duration | real | Duration in milliseconds |
success | bool | True if 2xx/3xx |
operation_Id | string | Correlation ID for distributed tracing |
cloud_RoleName | string | Service name (for multi-service apps) |
Section 13 — The Answer Selection Hierarchy
When choosing between two plausible answers, apply these preferences in order:
1Automated > manual — automated wins almost every time
2Earlier scan > later — shift-left always beats scan-at-deploy
3Build once > rebuild per env — immutable artefact promotion always wins
4Key Vault > any other secret storage
5Managed identity > service principal with secret
6Lower blast radius > higher — canary/blue-green beats big bang
7Fail pipeline > warn — for security findings
8SLO-linked alert > volume-based alert
9Trunk-based for speed — GitFlow only when question mentions multiple concurrent versions
10Sprint Retrospective = process, Review = demo — never mix these