Prev Next

Cloud / Azure DevOps Interview questions

Last updated

1. What is Azure DevOps? 2. What are the core services of Azure DevOps? 3. What is Azure Boards? 4. What is Azure Repos? 5. What is Azure Pipelines? 6. What is Azure Test Plans? 7. What is Azure Artifacts? 8. What is an organization in Azure DevOps? 9. What is a project in Azure DevOps? 10. What is a work item in Azure Boards? 11. What are the work item types in the Agile process? 12. What are the process templates available in Azure DevOps? 13. What are the version control options in Azure Repos? 14. What is a pull request in Azure Repos? 15. What is a YAML pipeline in Azure Pipelines? 16. What are the building blocks of a YAML pipeline? 17. What is an agent pool in Azure Pipelines? 18. What is a service connection in Azure DevOps? 19. What are branch policies in Azure Repos? 20. What is a variable group in Azure Pipelines? 21. What are environments in Azure Pipelines? 22. What are approvals and checks in Azure Pipelines? 23. What is the purpose of a Kanban board in Azure Boards? 24. What is the difference between Azure DevOps Services and Azure DevOps Server? 25. What is the difference between classic and YAML pipelines? 26. What is the difference between Microsoft-hosted and self-hosted agents? 27. What is the difference between stages, jobs and steps in a YAML pipeline? 28. What is the difference between pipeline artifacts and Azure Artifacts? 29. What is the difference between Azure DevOps and GitHub Actions? 30. What is the difference between the pull request merge types in Azure Repos? 31. How do triggers work in Azure Pipelines? 32. How do you store secrets securely in Azure Pipelines? 33. How does workload identity federation work for Azure service connections? 34. How do you reuse pipeline code with templates? 35. How do deployment strategies work in Azure Pipelines? 36. How do you build a multi-stage CI/CD pipeline for Azure App Service? 37. How do you run jobs in parallel in Azure Pipelines? 38. How do conditions control step and job execution? 39. How do you pass variables between jobs and stages? 40. How can you speed up a slow Azure Pipelines build? 41. How do you troubleshoot a failing Azure Pipelines run? 42. Explain the execution flow of a YAML pipeline run? 43. How do you link work items to commits and pull requests? 44. How do you manage permissions and access levels in Azure DevOps? 45. Which is better for releases, trunk-based development or GitFlow? 46. How do you deploy containers to AKS using Azure Pipelines? 47. How do you automate Azure DevOps with the CLI and REST API? 48. How do you provision infrastructure with Terraform in Azure Pipelines? 49. How do you roll back a bad deployment in Azure Pipelines? 50. How do you secure Azure Pipelines against malicious pull requests?

1. What is Azure DevOps?

Azure DevOps is Microsoft's platform for planning, building, testing and releasing software from one place. It bundles work tracking, Git hosting, CI/CD, test management and package feeds.

It grew out of Team Foundation Server and Visual Studio Team Services, and took the Azure DevOps name in 2018. It ships in two flavors: Azure DevOps Services, hosted by Microsoft, and Azure DevOps Server, installed on your own hardware.

The name is slightly misleading. Pipelines can build Java, Node.js, Python, Go or container images and deploy them to AWS, GCP or an on-premises server, so you are not tied to Azure or .NET.

Take quiz
Azure DevOps Services differs from Azure DevOps Server because it is:
installed only on your own SQL Server and IIS machines
limited to deploying workloads that run on Azure
hosted and updated by Microsoft in the cloud
available only for .NET projects
Azure DevOps is the renamed version of which earlier product?
Azure Resource Manager
Visual Studio Team Services (VSTS)
GitHub Enterprise Server
Microsoft Project Server

2. What are the core services of Azure DevOps?

Azure DevOps has five core services, and you can switch each one on or off per project.

Service What it does
Azure Boards Backlogs, Kanban boards, sprints and work item tracking
Azure Repos Private Git repositories (and legacy TFVC) with pull requests
Azure Pipelines CI/CD builds, tests and deployments
Azure Test Plans Manual and exploratory testing, test case management
Azure Artifacts Package feeds for NuGet, npm, Maven, Python and more

Teams often use only a slice of the suite, for example Pipelines for builds while keeping code in GitHub and tickets in Jira.

Take quiz
Which service hosts private NuGet and npm package feeds?
Azure Boards
Azure Test Plans
Azure Artifacts
Azure Repos
How many core services make up Azure DevOps?
Three: Boards, Repos and Pipelines
Five: Boards, Repos, Pipelines, Test Plans and Artifacts
Four: Boards, Pipelines, Artifacts and Monitor
Seven, including Functions and App Service

3. What is Azure Boards?

Azure Boards is the work tracking service. It lets teams capture requirements, bugs and tasks as work items and organize them on backlogs and boards.

The main views are:

  • Backlogs to rank and refine work
  • Kanban boards with columns, swimlanes and WIP limits
  • Sprints with a taskboard and capacity planning
  • Queries and dashboards for reporting
  • Delivery Plans for a calendar view across teams

Boards supports Scrum, Kanban and hybrid workflows, and work items can be linked to commits, pull requests and builds so you can trace a change back to its requirement.

Take quiz
Which Boards feature gives a cross-team timeline of features and epics?
The sprint taskboard
A pull request policy
Delivery Plans
An Artifacts feed view
Work items in Azure Boards can be traced to code because they can be:
exported only as spreadsheet rows
linked to commits, pull requests and builds
attached to agent pools
stored inside a package feed

4. What is Azure Repos?

Azure Repos hosts the source code for a project. It offers unlimited private Git repositories and, for older projects, centralized Team Foundation Version Control (TFVC).

Beyond hosting, it brings the collaboration layer: pull requests with inline comments, branch policies, code search, and webhooks or service hooks that notify other tools.

A single project can hold many Git repositories, so a team can split a monolith into several repos and still keep one backlog and one set of pipelines. Each repo has its own branches, permissions and policies, which is handy when different teams own different services.

Take quiz
What stops direct pushes to main and forces a review in Azure Repos?
An agent pool permission
A variable group lock
A feed upstream source
A branch policy that requires a pull request
How many Git repositories can one Azure DevOps project contain?
Exactly one
Only one per team member
Many, each with its own branches and policies
None, repos live at organization level

5. What is Azure Pipelines?

Azure Pipelines is the CI/CD service. It builds your code, runs tests and deploys the result to any target, whether that is Azure, another cloud, Kubernetes or a plain VM.

You define a pipeline in a YAML file (usually azure-pipelines.yml) or in the classic visual editor. The work then runs on an agent, which is either a Microsoft-hosted VM or a machine you manage yourself.

It works with repos in Azure Repos, GitHub, Bitbucket and others, so you do not have to move your code to use it.

Take quiz
Where does a YAML pipeline definition normally live?
Inside the Azure Boards backlog
In the repository, as a file like azure-pipelines.yml
In the agent pool settings page
In an Azure Artifacts feed
Which agent type needs no VM patching or upkeep from your team?
Microsoft-hosted agents
Self-hosted agents on your own VM
Agents installed on an on-premises build server
Agents you scale yourself in a VM scale set

6. What is Azure Test Plans?

Azure Test Plans is the service for manual, exploratory and user acceptance testing. Testers organize work into a test plan, which contains test suites, which contain test cases.

Testers run cases in the browser-based test runner, record pass or fail for each step, and file a bug straight from a failed step with screenshots and logs attached.

Automated tests are not run from here. They execute in a pipeline, and their results show up in the pipeline's Tests tab. Test Plans needs the Basic + Test Plans access level, so it is a paid feature.

Take quiz
Which hierarchy does Azure Test Plans use?
Test plan, then test suites, then test cases
Test case, then test plan, then test suite
Test suite, then pipeline, then test plan
Test run, then work item, then feed
Which browser extension captures exploratory testing sessions and files bugs?
Azure Artifacts Credential Provider
Pipeline Decorators
Service Hooks Connector
Test & Feedback

7. What is Azure Artifacts?

Azure Artifacts is the package management service. You create a feed and publish versioned packages to it, then consume them from builds or developer machines.

Supported formats include NuGet, npm, Maven, Gradle, Python (pip, twine), Cargo and Universal Packages for arbitrary files.

Feeds can use upstream sources to pull from public registries such as npmjs.com or NuGet.org. The first time someone requests a public package, the feed saves a copy, so builds keep working even if the public package is later removed.

Take quiz
What do upstream sources let an Artifacts feed do?
Push commits to GitHub automatically
Fetch and keep copies of packages from public registries
Share pipeline variables across projects
Auto-approve pull requests
Which of these package types can an Artifacts feed host?
NuGet, npm, Maven, Python and Cargo packages
Only NuGet packages
Only Docker images
Only ARM and Bicep templates

8. What is an organization in Azure DevOps?

An organization is the top-level container in Azure DevOps Services. It holds your projects, users, billing and settings, and it is what you sign in to at https://dev.azure.com/{organization}.

Several things are managed at this level rather than per project: user licenses and access levels, parallel job purchases, agent pools, installed marketplace extensions, and policies such as which authentication methods are allowed.

It is usually connected to a Microsoft Entra ID tenant, so sign-in and group membership follow your company directory. Many companies run one organization for the whole business and split teams into projects.

Take quiz
Which URL pattern identifies an Azure DevOps Services organization?
{organization}.azuredevops.net/portal
portal.azure.com/devops/{organization}
azure.microsoft.com/orgs/{organization}
dev.azure.com/{organization}
Which setting is managed at the organization level?
A single repository's branch policy
The WIP limit on one Kanban column
Installed extensions and parallel job capacity
The comments on one pull request

9. What is a project in Azure DevOps?

A project is a container inside an organization that groups the repos, boards, pipelines, test plans and feeds for a product or team.

When you create one you choose a name, visibility (private or public), the version control type, and the work item process (Basic, Agile, Scrum or CMMI).

Projects are the main security and reporting boundary. Permissions, area paths, iterations and dashboards are scoped to the project, which is why a mistake in one project does not leak into another.

Take quiz
Which choice do you make when creating a new project?
The Azure region for build agents
The pricing tier of Artifacts
The Terraform backend storage account
Visibility, version control type and work item process
What typically sits inside a project?
Other organizations
Microsoft Entra tenants
Repos, boards, pipelines, test plans and feeds
Azure subscriptions

10. What is a work item in Azure Boards?

A work item is a record that tracks one piece of work, such as a user story, a bug or a task. It has a title, description, State, assignee, tags and history.

Two fields place it in the plan. Area Path decides which team owns it, and Iteration Path decides which sprint it belongs to.

Work items can be linked as parent/child, related, or to Git artifacts like commits and pull requests. Those links are what let you answer 'which change shipped this requirement?' later.

Take quiz
Which pair of fields puts a work item on a team's sprint backlog?
Priority and Severity
Tags and Activity
Reason and Resolved Date
Area Path and Iteration Path
What does the State field of a work item track?
The Git branch it was built from
Which agent ran its tests
Its position in the workflow, such as New, Active or Closed
The reviewer who approved the code

11. What are the work item types in the Agile process?

The Agile process template defines these main types, arranged in a hierarchy:

Type Purpose
Epic Large business initiative spanning several features
Feature A deliverable capability made of several stories
User Story A requirement written from the user's point of view
Task A unit of work that implements a story, with hours
Bug A defect, tracked beside stories or tasks
Issue A blocker or risk that is not a product defect

Test Case, Test Plan and Test Suite also exist, and they are used by Azure Test Plans.

Take quiz
In the Agile process, which type sits directly above User Story?
Task
Bug
Issue
Feature
Which Agile work item type tracks a blocker that is not a code defect?
Epic
Test Case
Issue
Feature

12. What are the process templates available in Azure DevOps?

Azure DevOps ships four system processes. They differ mainly in vocabulary and the work item types they include.

Process Requirement type Best for
Basic Issue (with Epic and Task) Small teams that want the simplest setup
Agile User Story Teams using Agile planning
Scrum Product Backlog Item, plus Impediment Teams following Scrum events
CMMI Requirement, plus Change Request and Risk Formal, auditable processes

System processes are read-only. To add fields, states or custom types, create an inherited process from one of them and assign your project to it.

Take quiz
Which process uses Product Backlog Item and Impediment?
Scrum
Agile
CMMI
Basic
How do you add a custom field to a system process?
Edit the Agile process XML in place
Add a branch policy
Install an agent capability
Create an inherited process and customize that

13. What are the version control options in Azure Repos?

Azure Repos supports two models, Git and TFVC.

Git TFVC
Distributed: every clone holds full history Centralized: history lives on the server
Cheap, fast branching and local commits Branches are server-side copies, heavier to manage
Default for new projects and the industry standard Legacy option, mostly kept for older codebases

A project can have many Git repos, but only one TFVC repository. For new work, choose Git unless you are maintaining something that is already on TFVC. Tools such as git-tfs or Azure DevOps import can migrate TFVC history into Git when you are ready to move.

Take quiz
Which model needs a central server to record each check-in?
Git
TFVC
Both Git and TFVC equally
Neither, both are fully distributed
Which capability is a strength of Git compared with TFVC?
Local commits and lightweight branching
Server-side file locking
Centrally numbered changesets
A single repository per project

14. What is a pull request in Azure Repos?

A pull request (PR) asks to merge one branch into another, usually a feature branch into main. It gives reviewers a place to read the diff, leave comments and approve or reject.

In Azure Repos a PR can also trigger build validation, enforce branch policies, link work items, and be set to auto-complete once all policies pass.

Reviewers can also vote 'Approve with suggestions' or 'Wait for author'. A draft PR lets you share work in progress without it being completable.

Take quiz
What does 'Complete associated work items after merging' do?
Deletes the linked work items
Moves linked work items to a done state when the PR completes
Reassigns them to the reviewer
Creates one new task per commit
Which PR state shares code for early feedback but cannot be completed?
Draft
Abandoned
Auto-complete
Squash merge

15. What is a YAML pipeline in Azure Pipelines?

A YAML pipeline is a CI/CD definition stored as a text file in your repository. Because it is code, it is versioned, reviewed in pull requests, and branches carry their own copy.

A minimal example that builds on every push to main:

trigger:
- main

pool:
  vmImage: ubuntu-latest

steps:
- script: echo Building $(Build.BuildNumber)
  displayName: Say hello

Microsoft's newer features, like multi-stage deployments and templates, are built for YAML first.

Take quiz
What is the usual default file name created by the pipeline wizard?
azure-pipelines.yml
pipeline.json
build.config.xml
devops-ci.yaml.txt
A key advantage of YAML over the classic visual editor is that:
it no longer needs any agent
it removes the need for triggers
it works without a repository
pipeline changes get the same PR review and history as code

16. What are the building blocks of a YAML pipeline?

A pipeline is nested like this: pipeline, stages, jobs, steps. Smaller pipelines can skip the outer levels and list steps directly.

  • trigger / pr / schedules decide when it runs
  • pool picks the agent
  • variables and parameters hold configuration
  • stages group jobs, for example Build and Deploy
  • jobs run on one agent
  • steps are tasks or scripts executed in order
stages:
- stage: Build
  jobs:
  - job: Compile
    pool:
      vmImage: ubuntu-latest
    steps:
    - script: dotnet build

Take quiz
Which key under pool selects a Microsoft-hosted image such as ubuntu-latest?
agentImage
poolType
runnerLabel
vmImage
What is the smallest unit of work in a pipeline definition?
A stage
A job
A step
A trigger

17. What is an agent pool in Azure Pipelines?

An agent pool is a group of agents that can run your jobs. When a job is queued, Azure Pipelines hands it to a free agent in the pool whose capabilities match its demands.

Microsoft provides hosted pools such as ubuntu-latest, windows-latest and macos-latest. You can also create self-hosted pools made of your own machines.

An agent runs one job at a time. Agents poll Azure DevOps over outbound HTTPS, so they do not need an open inbound port. Pools are defined at organization level and shared to projects with permissions.

Take quiz
How many jobs can one agent run at the same moment?
As many as its CPU cores
Two, one build and one release
One
Unlimited, if memory allows
What does a self-hosted agent need to receive jobs?
A public inbound IP address
Outbound HTTPS access to Azure DevOps
An Azure subscription on the same VNet
A paid Test Plans license

18. What is a service connection in Azure DevOps?

A service connection stores how a project authenticates to an outside service such as an Azure subscription, a container registry, a Kubernetes cluster, GitHub or an SSH host.

Pipelines refer to it by name, so credentials never appear in YAML:

- task: AzureWebApp@1
  inputs:
    azureSubscription: 'prod-arm-connection'
    appName: 'orders-api'
    package: '$(Pipeline.Workspace)/drop/*.zip'

Use least privilege: scope the connection to one resource group, limit it to named pipelines, and add approvals or checks for sensitive ones. Review the list of connections regularly and delete any that are no longer used.

Take quiz
How does a YAML task refer to a service connection?
By its name in an input such as azureSubscription
By pasting the secret into the YAML
By the agent's host name
By the pull request number
Which practice best limits who can use a production service connection?
Share it with every project in the organization
Give it Owner on the whole subscription
Store its secret in a work item
Restrict it to specific pipelines and add approvals

19. What are branch policies in Azure Repos?

Branch policies are rules a branch must satisfy before a PR can complete. They are how you protect main from untested or unreviewed changes, and they also block direct pushes.

Policies are set per branch under Repos, Branches, Branch policies, and admins can bypass them only if granted that permission explicitly.

  • Minimum number of reviewers, with an option to block self-approval
  • Build validation to run a pipeline on each PR
  • Check for linked work items
  • Check for comment resolution
  • Limit merge types to squash, rebase and so on
  • Automatically included reviewers by path
Take quiz
Which policy makes sure the code compiles and tests pass before merge?
Check for comment resolution
Build validation
Limit merge types
Automatically included reviewers
What does 'Check for comment resolution' enforce?
Every comment thread must be resolved before the PR completes
Every comment needs an emoji reaction
Comments are deleted on merge
Only the author may comment

20. What is a variable group in Azure Pipelines?

A variable group is a named set of variables you define once under Pipelines, Library and reuse across many pipelines. Typical examples are connection strings or environment URLs that differ between dev and prod.

variables:
- group: shared-prod-settings
- name: buildConfiguration
  value: Release

Individual values can be marked secret. A group can also be linked to Azure Key Vault, so secrets stay in the vault and are fetched at run time. Access to the group itself is controlled with security roles, and a pipeline must be authorized before it can use it.

Take quiz
Where do you manage variable groups?
Repos, then Branches
Boards, then Queries
Project settings, then Teams
Pipelines, then Library
How can a variable group keep its secrets outside Azure DevOps?
Mark every variable as read-only
Export it to a CSV file
Link it to an Azure Key Vault
Rename it with a secret prefix

21. What are environments in Azure Pipelines?

An environment is a named deployment target such as dev, staging or production. It can contain resources like a Kubernetes namespace or VMs.

A deployment job points to an environment, and Azure DevOps then records the deployment history, including which run and commit are live there.

jobs:
- deployment: DeployWeb
  environment: production
  strategy:
    runOnce:
      deploy:
        steps:
        - script: echo Deploying

Approvals and checks attach to the environment, which makes it the natural place for production gates. Environments also make it easy to see what version is live in staging versus production at any moment.

Take quiz
Which job type targets an environment and records deployment history?
A plain job with only a pool
A server job
A deployment job
A template job
What extra visibility do environments add?
Per-line code coverage over time
Which run and commit are deployed to each target
Agent CPU usage graphs
Package download counts

22. What are approvals and checks in Azure Pipelines?

Approvals and checks pause a pipeline run before it uses a protected resource, until every condition is met.

They attach to resources such as environments, service connections, agent pools, variable groups, secure files and repositories. They are configured on the resource itself, not written in the YAML, so a developer editing the pipeline cannot remove them.

  • Manual approval from named users or groups
  • Branch control to allow only certain branches
  • Business hours windows
  • Invoke Azure Function / REST API for custom gates
  • Exclusive lock so one run deploys at a time
Take quiz
Which check allows deployment to production only from the main branch?
Branch control
Business hours
Exclusive lock
Invoke Azure Function
Where are approvals configured for a YAML pipeline?
With an approve: key inside each stage
In the commit message
In the agent's config file
On the protected resource, such as an environment

23. What is the purpose of a Kanban board in Azure Boards?

A Kanban board shows work as cards that move across columns such as New, Active, Resolved and Closed, so the team sees flow and bottlenecks at a glance.

Useful settings you can tune:

  • WIP limits highlight a column when it holds too many cards
  • Swimlanes separate work by class of service, for example expedite
  • Split columns divide a column into Doing and Done
  • Definition of done text shown on each column
  • Card fields and styles for quick status cues

Dragging a card to a new column updates the work item's state, so the board and the data never drift apart.

Take quiz
What does a WIP limit do on a Kanban column?
Blocks all pull requests
Caps agent minutes per sprint
Deletes the oldest cards
Warns when the column holds more cards than the cap
Which board feature separates urgent work from normal work?
Split columns
Delivery Plans
Swimlanes
Queries

24. What is the difference between Azure DevOps Services and Azure DevOps Server?

Both products offer the same core services. The difference is who runs it.

Azure DevOps Services Azure DevOps Server
Cloud service hosted by Microsoft Installed on your own servers
Updated continuously by Microsoft You schedule and apply updates yourself
Microsoft-hosted agents available Self-hosted agents only
Sign-in through Microsoft Entra ID Typically Active Directory
No database to manage You operate SQL Server and backups

Choose Server when data residency, air-gapped networks or regulation require everything on-premises. Otherwise Services removes a lot of operational work, and new features usually land there first.

Take quiz
Which option is only available on Azure DevOps Services?
Microsoft-hosted build agents
Self-hosted agents
Git repositories
Kanban boards
Why might a company pick Azure DevOps Server?
It receives features before the cloud version
It has no need for a database
It includes unlimited Microsoft-hosted agents
Its data must stay inside a private, on-premises network

25. What is the difference between classic and YAML pipelines?

Classic pipelines are built in a visual editor and stored in the service. YAML pipelines are text files that live in your repo.

Aspect Classic YAML
Definition Visual designer, stored in Azure DevOps Code in azure-pipelines.yml
Versioning Limited history Full Git history and PR review
Build and deploy Separate build and release pipelines Single multi-stage pipeline
Reuse Task groups Templates and parameters
Approvals Release gates and approvals Environments, checks and approvals

Classic still works, but Microsoft's new capabilities target YAML, so most teams migrate. A common path is to move the build first, then rebuild release stages as YAML stages with environments.

Take quiz
Which feature gives YAML pipelines reuse across projects?
Task groups in the Library
Release gates
Classic release definitions
Templates with parameters
In a classic setup, deployments are normally modeled as:
A pull request policy
A stage inside the build YAML only
A separate release pipeline
A variable group

26. What is the difference between Microsoft-hosted and self-hosted agents?

Microsoft-hosted agents are fresh VMs that Microsoft provisions for each job and discards afterwards. Self-hosted agents are machines you install and maintain yourself.

Microsoft-hosted Self-hosted
No maintenance, preinstalled tooling You patch the OS and install tools
Clean machine every job State, caches and tools persist between runs
Public internet access, no private network by default Can reach internal servers and databases
Job time limits and fixed VM sizes Your hardware, your size and limits

Pick self-hosted when you need private network access, special software or licenses, big caches, or faster repeated builds. Otherwise hosted is simpler and safer, since nothing leaks between runs.

Take quiz
Which agent type starts every job on a clean machine?
Self-hosted on a persistent VM
Both, always
Microsoft-hosted
Neither, state is always kept
When is a self-hosted agent the better fit?
You want zero OS patching
The job must reach servers inside a private network
You need a fresh VM for every run without effort
You only build open source samples

27. What is the difference between stages, jobs and steps in a YAML pipeline?

They are three nested levels, each with different run behavior.

Level Runs Default behavior
Stage A major phase such as Build or Deploy Run one after another, can have approvals
Job On a single agent Jobs in a stage can run in parallel
Step One task or script inside a job Run sequentially on the same agent

Because all steps of a job share one agent and workspace, files created in step 1 are visible in step 3. Two jobs run on different agents, so they do not share files unless you publish and download an artifact.

stages:
- stage: Build
  jobs:
  - job: Unit
    steps: [{script: echo unit}]
  - job: Lint
    steps: [{script: echo lint}]
- stage: Deploy
  dependsOn: Build
  jobs:
  - job: Release
    steps: [{script: echo release}]

Take quiz
Why can't one job see files created by another job?
Steps in a job run on different agents
Files are deleted when a stage ends
Each job usually runs on its own agent and workspace
Jobs may only write to Azure Artifacts
What is the default relationship between two stages with no dependsOn set?
They run fully in parallel
They run sequentially in the order written
The second is skipped
They share one agent

28. What is the difference between pipeline artifacts and Azure Artifacts?

The names are close but the purposes differ.

Pipeline artifacts Azure Artifacts feeds
Files produced by one pipeline run Versioned packages for developers to consume
Pass output between jobs, stages and pipelines Share libraries across teams and repos
Tied to the run and removed by retention Kept until you delete or apply retention policies
Published with publish: or PublishPipelineArtifact@1 Published with NuGet, npm, Maven and similar tools

Example: a build publishes a drop pipeline artifact that the deploy stage downloads. A shared logging library, however, goes to an Artifacts feed so other repos can install it by version.

Take quiz
You want to hand a compiled web app from a build job to a deploy stage. Which fits best?
An npm package on a public registry
A pipeline artifact
A variable group
A branch policy
A shared C# library used by ten repos should be published to:
An Azure Artifacts NuGet feed
A pipeline artifact that expires in 30 days
A Kanban board
An agent pool

29. What is the difference between Azure DevOps and GitHub Actions?

Both are Microsoft CI/CD options, but they sit in different ecosystems.

Azure DevOps (Pipelines) GitHub Actions
YAML pipelines, tasks, environments Workflows in .github/workflows, actions
Built-in Boards, Test Plans, Artifacts Issues, Projects, Packages, and Marketplace actions
Strong approvals, checks and release tracking Environment protection rules and reusable workflows
Can build code from GitHub or other hosts too Tightest fit when code is already on GitHub

The usual deciding factor is where code and planning already live. Many companies run both, for example GitHub for code and Actions for open source, Azure DevOps for enterprise planning and regulated release flows.

Take quiz
Where are GitHub Actions workflow files stored?
In the .github/workflows folder of the repo
In the Azure Pipelines Library
In an Artifacts feed
In the agent pool settings
Which factor most often decides between the two tools?
Which one supports YAML
Which one can run on Linux
Which one has Git support
Where the team's code and planning already live

30. What is the difference between the pull request merge types in Azure Repos?

When completing a PR you choose how history is written to the target branch.

Merge type Result
Merge (no fast-forward) Keeps all commits and adds a merge commit
Squash merge Collapses the branch into one commit on the target
Rebase and fast-forward Replays commits onto the target with no merge commit
Semi-linear merge Rebases the commits, then adds a merge commit

Squash gives a tidy main history but loses individual commits. Rebase keeps a linear history with detail. No-fast-forward preserves the true branching story. Teams usually pick one and enforce it with the Limit merge types branch policy.

Take quiz
Which merge type turns a whole PR into a single commit on main?
Merge (no fast-forward)
Semi-linear merge
Squash merge
Rebase and fast-forward
Which branch policy restricts the allowed merge strategies?
Build validation
Limit merge types
Check for linked work items
Require a minimum number of reviewers

31. How do triggers work in Azure Pipelines?

A trigger decides what starts a run. YAML pipelines support several kinds.

  • CI trigger (trigger:) runs on pushes to listed branches, tags or paths
  • PR trigger (pr:) validates pull requests for GitHub and Bitbucket repos
  • Scheduled (schedules:) uses cron syntax, in UTC
  • Pipeline resource trigger runs when another pipeline completes
trigger:
  branches:
    include: [main, release/*]
  paths:
    exclude: [docs/*]

schedules:
- cron: '0 2 * * *'
  displayName: Nightly build
  branches:
    include: [main]
  always: true

One catch: for Azure Repos Git, the pr: key is ignored. PR builds are set through a build validation branch policy instead. Use trigger: none to turn CI off, and [skip ci] in a commit message to skip a single run.

Take quiz
How do you run a build on every PR in an Azure Repos Git repository?
Add a pr: block to the YAML
Add a build validation branch policy
Create a scheduled cron trigger
Set trigger: none
What does always: true do on a schedule?
Runs even if nothing changed since the last run
Runs on every commit
Disables the CI trigger
Allows manual approval skipping

32. How do you store secrets securely in Azure Pipelines?

Keep secrets out of YAML and source control. Use one of these, from most to least preferred:

  1. Azure Key Vault, through a linked variable group or the AzureKeyVault@2 task, so secrets live in the vault
  2. Secret variables, marked secret in the pipeline or a variable group
  3. Secure files for certificates and keystores
  4. Service connections instead of raw credentials wherever possible

Secret variables are masked in logs but are not passed to scripts automatically. Map them explicitly:

steps:
- script: ./deploy.sh
  env:
    API_KEY: $(apiKey)

Log masking is a safety net, not a guarantee. Never echo secrets, and by default builds of forked repositories do not get them.

Take quiz
Why must you map a secret variable into a script's env block?
Secrets are not exposed to scripts automatically
Env blocks encrypt the value
Scripts can only read plain variables
Pipelines drop secrets after one step
Which store keeps secrets outside Azure DevOps entirely?
Variable group without the secret flag
A YAML comment
A work item field
Azure Key Vault

33. How does workload identity federation work for Azure service connections?

Workload identity federation lets a pipeline sign in to Azure without any stored secret. Azure DevOps issues a short-lived OIDC token for the run, and Microsoft Entra ID trusts it through a federated credential on an app registration or managed identity.

sequenceDiagram
  participant P as Pipeline run
  participant D as Azure DevOps
  participant E as Microsoft Entra ID
  participant R as Azure resource
  P->>D: Request OIDC token
  D-->>P: Signed token (issuer, subject)
  P->>E: Exchange token
  E-->>P: Access token
  P->>R: Deploy with access token

The federated credential matches on the issuer and a subject that identifies your organization, project and service connection. Since there is no client secret, nothing can expire silently at 2 a.m. or leak from a variable.

It is the recommended way to create new Azure Resource Manager connections. Existing secret-based connections can be converted from the connection's settings.

Take quiz
What replaces the stored client secret in workload identity federation?
A PAT stored in a variable group
An SSH key on the agent
A short-lived OIDC token trusted through a federated credential
A password in the YAML file
What is an operational benefit of this approach?
Pipelines no longer need agents
No secret expiry to renew or rotate
Approvals are skipped automatically
Deployment time drops to zero

34. How do you reuse pipeline code with templates?

Templates let you define steps, jobs, stages or variables once and reference them from many pipelines. They accept typed parameters, which are expanded at compile time before the run starts.

# templates/build-steps.yml
parameters:
- name: configuration
  type: string
  default: Release
steps:
- script: dotnet build -c ${{ parameters.configuration }}

# azure-pipelines.yml
steps:
- template: templates/build-steps.yml
  parameters:
    configuration: Debug

Templates can live in a separate repo through resources.repositories and be called as template.yml@shared. There is also extends, where the pipeline must build on a required template, which is how platform teams enforce mandatory steps such as security scans.

Take quiz
When are template parameters expanded?
Only after the last step finishes
At compile time, before the run starts
On the agent while the job runs
Only when a PR is approved
Which keyword forces a pipeline to follow a mandatory base template?
extends
include
inherits
depends

35. How do deployment strategies work in Azure Pipelines?

A deployment job supports three strategies. Each exposes lifecycle hooks where you place steps.

Strategy Idea
runOnce Run the hooks a single time, the simplest option
rolling Update VM targets in batches, so some always stay online
canary Send a small share of traffic to the new version first, then raise it

Hooks run in order: preDeploy, deploy, routeTraffic, then postRouteTraffic. If something fails, the on: failure hook runs, which is the place to roll back.

strategy:
  canary:
    increments: [10, 50]
    deploy:
      steps:
      - script: ./deploy.sh
    on:
      failure:
        steps:
        - script: ./rollback.sh

Take quiz
Which strategy releases to a small percentage of targets before the rest?
runOnce
rolling
canary
blueGreen
Where do you put rollback steps for a failed deployment job?
In preDeploy
In the on: failure hook
In the trigger block
In a variable group

36. How do you build a multi-stage CI/CD pipeline for Azure App Service?

Use one YAML file with a Build stage that produces an artifact and one deployment stage per environment.

trigger: [main]
pool:
  vmImage: ubuntu-latest

stages:
- stage: Build
  jobs:
  - job: Build
    steps:
    - task: DotNetCoreCLI@2
      inputs:
        command: publish
        publishWebProjects: true
        arguments: '-c Release -o $(Build.ArtifactStagingDirectory)'
    - publish: $(Build.ArtifactStagingDirectory)
      artifact: drop

- stage: Staging
  dependsOn: Build
  jobs:
  - deployment: Deploy
    environment: staging
    strategy:
      runOnce:
        deploy:
          steps:
          - task: AzureWebApp@1
            inputs:
              azureSubscription: 'arm-connection'
              appType: webAppLinux
              appName: 'orders-staging'
              package: '$(Pipeline.Workspace)/drop/**/*.zip'

Add a Production stage the same way, and put a manual approval on the production environment. Build once and deploy the same artifact everywhere, so what you tested is exactly what ships.

Take quiz
Why deploy the same artifact to staging and production?
It makes the pipeline run faster than any other design
It avoids needing an environment
It removes the need for approvals
So the tested build is exactly what reaches production
Where do you place the manual approval for production in this design?
In the Build stage's steps
In the trigger section
On the production environment
In the artifact name

37. How do you run jobs in parallel in Azure Pipelines?

Jobs in the same stage start in parallel by default. You control order with dependsOn and fan out copies with strategy.

jobs:
- job: Test
  strategy:
    matrix:
      node18:
        nodeVersion: 18
      node20:
        nodeVersion: 20
    maxParallel: 2
  steps:
  - script: echo Testing on Node $(nodeVersion)

A matrix creates one job per entry. parallel: N splits a test run into slices, useful with the VSTest task.

Real parallelism is limited by your parallel job capacity. If you have two parallel jobs and queue five, three wait. Check capacity under Organization settings, Parallel jobs.

Take quiz
What limits how many jobs actually run at the same time?
Your purchased or granted parallel job capacity
The number of stages in the YAML
The number of branches in the repo
The pull request count
Which strategy creates one job per configuration entry?
slice
rolling
extends
matrix

38. How do conditions control step and job execution?

Every step, job and stage has an implicit condition of succeeded(). Add condition: to change that.

Expression Runs when
succeeded() All previous dependencies succeeded (default)
failed() A previous dependency failed
succeededOrFailed() Always, except when the run was cancelled
always() Always, even when cancelled

- task: PublishTestResults@2
  condition: succeededOrFailed()
  inputs:
    testResultsFiles: '**/TEST-*.xml'

- script: ./deploy.sh
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))

Prefer succeededOrFailed() for reporting steps, because always() keeps running after a user cancels. Conditions are evaluated at run time, while ${{ if }} expressions are resolved at compile time.

Take quiz
Which condition publishes test results after a failure but not after cancellation?
succeededOrFailed()
always()
failed()
canceled()
When is a ${{ if }} template expression evaluated?
After each step
Only when the job fails
Only on self-hosted agents
At compile time, before the run

39. How do you pass variables between jobs and stages?

Setting a variable in a step only affects later steps in the same job. To share it further, create an output variable.

jobs:
- job: A
  steps:
  - script: echo "##vso[task.setvariable variable=version;isOutput=true]1.4.2"
    name: setVer
- job: B
  dependsOn: A
  variables:
    appVersion: $[ dependencies.A.outputs['setVer.version'] ]
  steps:
  - script: echo $(appVersion)

  • The producing step needs a name
  • Across jobs, read it with dependencies.JobName.outputs['step.var']
  • Across stages, use stageDependencies.Stage.Job.outputs['step.var']

The consuming job must declare dependsOn, or the value will be empty.

Take quiz
What must the producing step have so its output can be read later?
A condition of always()
A matrix strategy
A secret flag
A name, and isOutput=true on the variable
How does a job in a later stage read an output from an earlier stage?
With $(Build.Artifact)
With dependencies.Stage.outputs only
With stageDependencies.Stage.Job.outputs
It is shared automatically

40. How can you speed up a slow Azure Pipelines build?

Measure first. The run summary shows time per job and step, so start with the biggest one.

  • Cache dependencies with Cache@2 for npm, NuGet, pip or Maven
  • Run independent jobs in parallel and split large test suites
  • Shallow clone with fetchDepth: 1 for big repositories
  • Path filters so docs-only changes do not trigger a full build
  • Self-hosted agents keep warm caches and Docker layers
  • Remove unneeded restore and publish steps
- task: Cache@2
  inputs:
    key: 'npm | "$(Agent.OS)" | package-lock.json'
    restoreKeys: |
      npm | "$(Agent.OS)"
    path: $(Pipeline.Workspace)/.npm
- script: npm ci --cache $(Pipeline.Workspace)/.npm

The cache key includes the lock file hash, so it refreshes only when dependencies change.

Take quiz
Why does the cache key include a hash of package-lock.json?
To encrypt the cache contents
So the cache refreshes only when dependencies change
To make the job run on Windows
To avoid using restoreKeys
Which setting reduces clone time for a very large repo?
fetchDepth: 1
maxParallel: 1
condition: always()
trigger: none

41. How do you troubleshoot a failing Azure Pipelines run?

Work from the outside in.

  1. Open the run and expand the first red step. Later errors are often side effects.
  2. Re-run with Enable system diagnostics, or set system.debug: true, for verbose logs.
  3. If it never started, check for the message This pipeline needs permission to access a resource and approve it.
  4. Check YAML validation errors, such as indentation or an unknown template path.
  5. Verify the service connection still works and has the right role on the target.
  6. For self-hosted agents, read the _diag logs and confirm the agent is online and meets demands.
  7. Reproduce locally with the same commands and versions.

Jobs stuck in Queued usually mean no free agent or no parallel job capacity, not a code problem.

Take quiz
A run sits in Queued for a long time. What is the most likely cause?
A syntax error in a C# file
A missing branch policy
An unresolved PR comment
No free agent or no available parallel job capacity
Which setting gives verbose logs when you re-run a pipeline?
fetchDepth
isOutput
Enable system diagnostics (system.debug)
maxParallel

42. Explain the execution flow of a YAML pipeline run?

A run goes through a compile phase and then an execution phase.

flowchart TD
  A["Trigger fires"] --> B["YAML compiled"]
  B --> C["Templates and parameters expanded"]
  C --> D["Run created with stages"]
  D --> E{Approvals and checks pass?}
  E -- No --> F["Wait or fail"]
  E -- Yes --> G["Job queued to agent pool"]
  G --> H["Agent picks up job"]
  H --> I["Steps run in order"]
  I --> J["Logs, results and artifacts published"]
  J --> K["Next stage starts"]
  1. A trigger, schedule, PR or manual run starts it.
  2. Azure DevOps reads the YAML, expands templates and ${{ }} expressions, and validates it.
  3. For each stage, protected resources are checked and approvals collected.
  4. Each job is queued, and a matching agent from the pool picks it up.
  5. The agent runs the steps and streams logs. Task outputs and artifacts are uploaded.
  6. Dependent stages then start, and the run ends as succeeded, failed or cancelled.

Knowing the split helps in debugging: a syntax or template error fails before any agent is used, while a script error appears in the step log.

Take quiz
What happens before any agent is assigned to a run?
The artifacts are published
The YAML is compiled and templates are expanded
The steps execute in order
The next stage starts
Where do approvals and checks fit in the run flow?
Before a stage uses a protected resource
After the run completes
During YAML authoring only
Only inside script steps

Linking creates traceability from requirement to code to release.

  • In Azure Repos, add #123 in a commit message or PR description to link work item 123
  • In the PR, use Work items to add links manually
  • Create a branch straight from a work item using Create a branch in its Development section
  • With a GitHub repo connected to Boards, use AB#123, and Fixes AB#123 can move it to Done on merge

To enforce it, enable the Check for linked work items branch policy. Tick Complete associated work items after merging when finishing the PR so states update automatically.

Later, the work item's Development section shows the branches, commits and PRs, and the build summary lists which items shipped.

44. How do you manage permissions and access levels in Azure DevOps?

Two separate systems work together, and mixing them up is a common interview slip.

Access levels Permissions
Decide which features a user can use (what they pay for) Decide what a user or group can do
Stakeholder, Basic, Basic + Test Plans, Visual Studio subscriber Allow, Deny or Not set on a security group or object
Set per user at organization level Set at organization, project and object (repo, branch, pipeline, area path)

Built-in groups include Project Administrators, Contributors and Readers. Best practice is to grant permissions to Entra ID groups, not individuals.

Deny overrides Allow, apart from a few admin cases, and permissions inherit down unless broken. Stakeholder access is free and limited, and Basic is free for the first five users.

Take quiz
Which concept controls which Azure DevOps features a user's license unlocks?
Security group
Branch policy
Area path
Access level
If a user is Allowed through one group and Denied through another, what usually wins?
Allow
Whichever group was created first
Deny
The most recently added member

45. Which is better for releases, trunk-based development or GitFlow?

Neither is universally better. It depends on how you ship.

Trunk-based GitFlow
Short-lived branches merged to main daily Long-lived develop, release and hotfix branches
Needs strong CI and often feature flags More ceremony, easier to hold back a release
Fits web apps and continuous delivery Fits versioned products with several supported releases

For most Azure Pipelines teams deploying services, trunk-based wins: fewer merge conflicts, faster feedback and simpler pipelines, with branch policies and build validation protecting main.

Microsoft's own release flow is a middle path: work happens on short topic branches off main, release branches are cut when shipping, and hotfixes are cherry-picked to them. Pick GitFlow when you really maintain multiple versions in parallel.

Take quiz
Which approach fits continuous delivery of a web service best?
GitFlow with a six-month develop branch
One branch per developer, never merged
Trunk-based development with short-lived branches
Manual file copying between folders
What does Microsoft's release flow do when shipping?
Merges develop into master weekly
Cuts a release branch from main and cherry-picks hotfixes into it
Stops using pull requests
Deploys directly from developer machines

46. How do you deploy containers to AKS using Azure Pipelines?

The usual flow is build an image, push it to Azure Container Registry, then deploy manifests to AKS.

- stage: Build
  jobs:
  - job: Image
    steps:
    - task: Docker@2
      inputs:
        containerRegistry: 'acr-connection'
        repository: 'shop/api'
        command: buildAndPush
        Dockerfile: 'Dockerfile'
        tags: $(Build.BuildId)

- stage: Deploy
  jobs:
  - deployment: AKS
    environment: 'prod.shop'
    strategy:
      runOnce:
        deploy:
          steps:
          - task: KubernetesManifest@1
            inputs:
              action: deploy
              manifests: 'k8s/deployment.yml'
              containers: 'myregistry.azurecr.io/shop/api:$(Build.BuildId)'

Tagging with $(Build.BuildId) keeps every image traceable to a run. The prod.shop environment resource points at a Kubernetes namespace, so approvals and deployment history work as usual. For Helm charts, swap in the HelmDeploy@1 task.

Take quiz
Why tag images with $(Build.BuildId)?
It makes the image smaller
Each image can be traced back to a specific pipeline run
It removes the need for a registry
It encrypts the image
Which task pushes a built image to Azure Container Registry?
Docker@2 with command buildAndPush
PublishPipelineArtifact@1
AzureKeyVault@2
Cache@2

47. How do you automate Azure DevOps with the CLI and REST API?

Two options cover most scripting needs.

Azure DevOps CLI is an extension for the Azure CLI:

az extension add --name azure-devops
az devops configure --defaults organization=https://dev.azure.com/contoso project=Shop
az pipelines run --name "Shop-CI" --branch main
az repos pr create --source-branch feature/x --target-branch main
az boards work-item create --title "Fix login" --type Bug

The REST API gives full coverage at https://dev.azure.com/{org}/{project}/_apis/...?api-version=7.1. Typical uses are bulk work item updates, custom reports and queuing runs from other systems.

Authenticate with a Microsoft Entra token or a PAT. Prefer Entra tokens, and keep any PAT narrowly scoped and short-lived. Inside a pipeline, $(System.AccessToken) is available for calls back to the same organization.

Take quiz
Which command installs the Azure DevOps CLI extension?
az extension add --name azure-devops
npm install azure-devops-cli
dotnet tool install az-devops
pip install az-pipelines
Which token can a running pipeline use to call the Azure DevOps API?
$(Build.BuildId)
$(Agent.Name)
$(Pipeline.Workspace)
$(System.AccessToken)

48. How do you provision infrastructure with Terraform in Azure Pipelines?

Split the work into a plan stage and an apply stage, with a human gate in between.

  1. Store Terraform state in an Azure Storage backend with locking.
  2. Authenticate through an Azure service connection, ideally using workload identity federation.
  3. Run init, validate and plan -out=tfplan, then publish the plan as an artifact.
  4. Put apply in a deployment job tied to an environment that requires approval.
- task: AzureCLI@2
  inputs:
    azureSubscription: 'arm-connection'
    scriptType: bash
    scriptLocation: inlineScript
    addSpnToEnvironment: true
    inlineScript: |
      export ARM_CLIENT_ID=$servicePrincipalId
      export ARM_OIDC_TOKEN=$idToken
      export ARM_TENANT_ID=$tenantId
      export ARM_SUBSCRIPTION_ID=$(az account show --query id -o tsv)
      export ARM_USE_OIDC=true
      terraform init
      terraform plan -out=tfplan

Apply the saved plan file so what was reviewed is exactly what runs.

Take quiz
Why apply a saved plan file rather than re-planning in the apply stage?
It makes Terraform skip state locking
The reviewed changes are exactly the ones applied
It avoids needing a backend
It lets you skip approvals
Where should Terraform state be kept for a team pipeline?
In a remote backend such as Azure Storage with locking
On the build agent's local disk
In the pipeline's YAML file
In a work item attachment

49. How do you roll back a bad deployment in Azure Pipelines?

Plan rollback before you need it. The right method depends on the target.

  • Revert and redeploy: git revert the change and let the pipeline ship it. This is the cleanest option because history stays honest.
  • Redeploy the last good artifact: re-run the earlier successful run's deploy stage, as long as its artifacts are still retained.
  • App Service slots: swap the staging slot back to production.
  • Kubernetes: use kubectl rollout undo or the reject action of KubernetesManifest.
  • Deployment strategy hooks: put recovery steps in on: failure.
  • Feature flags: switch the feature off without redeploying.

Make sure artifact retention covers your rollback window, and that database changes are backward compatible, since code rolls back more easily than data.

Take quiz
Which rollback method keeps the Git history clean and auditable?
Force-push over main
Delete the failed run
git revert, then let the pipeline redeploy
Edit the release in the portal only
What must still exist to redeploy a previous run's build output?
Its open pull request
Its retained pipeline artifacts
Its Kanban card
Its agent's local temp folder

50. How do you secure Azure Pipelines against malicious pull requests?

Assume a PR author can change the pipeline YAML and the scripts it runs, so protect what that code can reach.

  • Fork builds: keep secrets unavailable to forks, and require a team member's comment before building them
  • Protected resources: add approvals and branch control checks to production environments and service connections
  • Restrict service connections to named pipelines with least privilege
  • Required templates: use an extends template check so mandatory steps cannot be removed
  • Limit job authorization scope to the current project and protect repository access
  • Isolate agents: run untrusted code on Microsoft-hosted agents, not shared self-hosted machines
  • Avoid script injection: do not paste values like branch names directly into script text

The goal is simple: code from an unreviewed branch should never be able to reach production credentials without a person approving it.

Take quiz
Why run builds of untrusted PRs on Microsoft-hosted agents?
They have unlimited minutes
Each job gets a clean, discarded VM so nothing persists
They skip all branch policies
They can reach every internal server
Which control stops a PR's pipeline from using a production service connection?
Branch control or approval checks on the connection
Adding more reviewers on Boards
A longer commit message
Renaming the pipeline
«
»

Comments & Discussions