AZ-400 ยท Maintaining pipelines
Optimizing cost, time and concurrency
Caching, shallow fetch, incremental builds, splitting and parallelizing, right-sizing agents, parallel job and concurrency settings, concurrency groups in GitHub Actions, cost of hosted vs self-hosted.
Key points
- Cache@2: key from a lock file hash, restoreKeys as fallback.
- Checkout: fetchDepth, fetchFilter, sparse checkout.
- Also: parallel jobs, incremental builds.
- Azure DevOps parallel jobs: consumed only while a job runs on an agent.
- GitHub Actions concurrency groups: cancel-in-progress drops older runs.
- Microsoft-hosted: zero maintenance, metered by parallel job. Self-hosted: upkeep, no per-job time limit.
Source: https://learn.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops
Practice questions
Which two inputs are required by the Cache@2 task in Azure Pipelines?
- key and restoreKeys
- path and cacheHitVar
- key and path
- scope and path
Show answer
Answer: C. key and path
Cache@2 needs a key that identifies the cache and a path to the folder to cache. restoreKeys and cacheHitVar are optional.
Which checkout settings reduce the amount of Git data an Azure Pipelines job downloads?
- fetchDepth: 1
- fetchFilter: blob:none
- sparseCheckoutDirectories: src
- fetchDepth: 0
- lfs: true
Show answer
Answer: A. fetchDepth: 1, B. fetchFilter: blob:none, C. sparseCheckoutDirectories: src
A small fetchDepth, a treeless or blobless fetchFilter, and sparse checkout directories all limit what is fetched. fetchDepth 0 fetches the full history, and lfs: true adds large files.
Buying one Microsoft-hosted parallel job when you are on the free tier lets you run two jobs at the same time.
Show answer
Answer: False
False. Your first purchase only removes the time limits on the first job; you still have one parallel job. To run two at once you must buy two.
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.
