Bitzu

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

Single choice

Which two inputs are required by the Cache@2 task in Azure Pipelines?

  1. key and restoreKeys
  2. path and cacheHitVar
  3. key and path
  4. 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.

Select all that apply

Which checkout settings reduce the amount of Git data an Azure Pipelines job downloads?

  1. fetchDepth: 1
  2. fetchFilter: blob:none
  3. sparseCheckoutDirectories: src
  4. fetchDepth: 0
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More AZ-400 topics in this module