End-to-end DevOps platform โ Classic Editor, YAML Pipelines, User Management, Permissions, Artifacts, and production release patterns.
15
Chapters
30+
Pipelines
100%
Free
01๐ต
Introduction to Azure DevOps
One Platform for Everything
Azure DevOps is like a Swiss Army knife for software teams โ it has Git repos, project boards, CI/CD pipelines, artifact storage, and test management all in one place. Unlike Jenkins (which only does CI/CD), Azure DevOps handles the entire software lifecycle from planning to deployment.
The 5 Services โ Think of Them as 5 Rooms
๐
Azure Repos
Your code lives here. Git repositories with pull requests, branch protection, and code review. Like GitHub but integrated into Azure DevOps.
๐
Azure Boards
Track work: user stories, bugs, tasks. Kanban boards, sprint planning, backlogs. Like Jira but built into the same platform.
โ๏ธ
Azure Pipelines
Automate builds and deployments. Classic Editor (UI) or YAML (code). This is the CI/CD engine โ the heart of DevOps.
๐ฆ
Azure Artifacts
Store private packages โ NPM, Maven, NuGet, Python. Like a private Nexus or JFrog inside Azure DevOps.
๐งช
Azure Test Plans
Manual and automated testing. Link test cases to user stories. Track test coverage.
Feature
Azure DevOps
GitHub Actions
Jenkins
Hosting
Cloud + On-prem (Server)
Cloud only
Self-hosted only
Pipeline
YAML + Classic UI
YAML only
Groovy (Jenkinsfile)
Project Boards
Built-in (Boards)
GitHub Issues
None (use Jira)
Artifact Registry
Built-in (Artifacts)
GitHub Packages
External (Nexus)
Best For
Enterprise + Azure + .NET
Open source + GitHub
Full control + plugins
02๐ข
Organization & Project Setup
Structure Your Azure DevOps
Azure DevOps has a hierarchy: Organization โ Project โ Repos/Pipelines/Boards. Think of Organization as your company, Projects as departments, and Repos as individual applications.
Hierarchy Explained
๐ข
Organization
Top level โ your company name. Users, billing, and policies live here. URL: dev.azure.com/yourcompany
๐
Project
A workspace for a team or product. Has its own repos, boards, and pipelines. Example: "E-Commerce Platform" or "Mobile App"
๐
Repository
One Git repo inside a project. A project can have multiple repos. Example: order-service, user-service, frontend
Creating Your First Project
โGo to dev.azure.com โ Sign in with Microsoft account
โCreate Organization (your company name)
โClick "New Project" โ Name: "my-first-project"
โChoose visibility: Private (default) or Public
โVersion Control: Git (always Git, never TFVC for new projects)
โWork Item Process: Agile (recommended) or Scrum or Basic
โClick Create โ Your project is ready!
๐ก Free Tier
Azure DevOps is FREE for up to 5 users with unlimited private repos and 1800 minutes/month of pipeline time. More than enough for small teams and learning.
03๐
Azure Repos & Branch Policies
Code Management Done Right
Azure Repos hosts your Git repositories. The killer feature is Branch Policies โ rules that prevent bad code from reaching your main branch. No one can push directly to main. Every change must go through a pull request with reviews and passing builds.
Branch Policies โ Non-Negotiable for Production
โRequire pull request to merge โ NO direct push to main allowed
โMinimum reviewers: 2 approvals required (at least 1 must be from code owners)
โBuild validation: CI pipeline MUST pass before merge is allowed
โLinked work item: every PR must reference a user story or bug (traceability)
โComment resolution: ALL code review comments must be resolved
โReset votes on push: if developer pushes new commits, previous approvals are reset
โSquash merge: clean single-commit history on main branch
Pull Request Workflow
WORKFLOW# 1. Developer creates feature branch
git checkout -b feature/payment-gateway
# 2. Developer makes changes and pushes
git add . && git commit -m "feat: add Razorpay integration"
git push origin feature/payment-gateway
# 3. Azure DevOps auto-creates Pull Request link
# 4. CI pipeline runs automatically on the PR
# 5. 2 reviewers review the code and approve
# 6. All checks pass โ Merge button becomes available
# 7. Squash merge into main โ clean history
# 8. Feature branch auto-deleted
04๐
Azure Boards
Track Work Like a Pro
Boards is the project management tool โ think of it as Jira built into Azure DevOps. You create user stories, break them into tasks, track them on Kanban boards, and link them to commits and pull requests for full traceability.
Work Item Types
Type
Purpose
Example
Epic
Large business initiative (months)
Launch Payment Module
Feature
Deliverable functionality (weeks)
Razorpay Integration
User Story
User-facing requirement
As a user, I want to pay via UPI
Task
Technical work (hours/days)
Create Razorpay API wrapper
Bug
Defect to fix
Payment fails for amounts > 10000
๐ก Auto-Linking
Include work item ID in commits or PR titles: "feat: add UPI flow #1234" โ Azure DevOps automatically links the commit to work item #1234. In Boards, you can see which commits and PRs relate to each story. Full traceability from requirement to deployment.
05๐ฑ๏ธ
Classic Editor Pipelines
UI-Based Build & Release โ No YAML Needed
Classic Editor lets you build CI/CD pipelines by clicking buttons and filling forms in the web UI โ no YAML knowledge needed. It is great for beginners and simple pipelines, but YAML is recommended for production because it is version-controlled.
Creating a Classic Build Pipeline
โGo to Pipelines โ New Pipeline โ Click "Use the classic editor" link at bottom
โSelect source: Azure Repos Git โ Pick your repository and branch
โChoose template: ".NET Core" or "Maven" or "Node.js" or start with "Empty Job"
โAgent Pool: Azure Pipelines (Microsoft-hosted) or your self-hosted pool
โAdd tasks by clicking the + button: Get Sources โ Build โ Test โ Publish
โConfigure triggers: Enable "Continuous Integration" checkbox โ builds on every push
โSave & Queue โ Your first build runs!
Classic vs YAML โ Honest Comparison
Classic Editor
YAML Pipeline
Click buttons to configure
Write YAML code
Stored in Azure DevOps (not in Git!)
Stored in Git repo as azure-pipelines.yml
Cannot be code-reviewed in PR
Can be reviewed in pull requests
Easy to start, hard to maintain
Harder to start, easy to maintain
No version history
Full Git history for pipeline changes
Good for learning and demos
Required for production
Limited to available UI options
Full flexibility with scripts and conditions
Classic Release Pipeline (CD)
Classic Release pipelines are a separate concept โ they take the output (artifact) from a Build pipeline and deploy it across environments. They have a visual stage editor that is very intuitive.
โGo to Pipelines โ Releases โ New Release Pipeline
โSelect template: "Azure App Service deployment" or "Empty job"
โAdd Artifact: Select your Build pipeline as source
โConfigure Approvals: Click the lightning bolt icon โ Add approvers for Staging and Production
โEnable Continuous Deployment trigger: auto-deploys when new build artifact is ready
โ ๏ธ Classic Releases are Legacy
Microsoft is pushing teams toward YAML-based multi-stage pipelines. Classic Releases still work and are supported, but new features are only added to YAML. Learn YAML for long-term career growth.
06๐
YAML Pipeline Basics
Pipeline as Code โ The Modern Way
YAML pipelines live in your Git repository as a file called azure-pipelines.yml. Every change to the pipeline is tracked in Git, can be code-reviewed, and is fully reproducible. This is the recommended approach for all new projects.
Complete YAML Pipeline โ Line by Line
AZURE-PIPELINES.YML# azure-pipelines.yml โ stored in your Git repo root
trigger: # WHEN does it run?
branches:
include:
- main # Run on push to main
- release/* # Run on push to release branches
exclude:
- feature/experimental # Skip this branch
pool: # WHERE does it run?
vmImage: 'ubuntu-latest' # Microsoft-hosted Ubuntu agent
variables: # WHAT values do we need?
buildConfiguration: 'Release'
appName: 'order-service'
stages:
- stage: Build # STAGE 1: Build
displayName: 'Build & Test'
jobs:
- job: BuildJob
displayName: 'Build the application'
steps:
- script: echo "Building $(appName)" # Use variable with $()
displayName: 'Print app name'
- script: mvn clean package -DskipTests=false
displayName: 'Maven Build & Test'
- task: PublishBuildArtifacts@1 # Save output for deploy stage
inputs:
PathtoPublish: 'target/app.jar'
ArtifactName: 'drop'
- stage: Deploy # STAGE 2: Deploy
displayName: 'Deploy to Staging'
dependsOn: Build # Only runs if Build succeeds
jobs:
- deployment: DeployWeb # Special deployment job
environment: 'staging' # Links to environment (approvals here)
strategy:
runOnce:
deploy:
steps:
- download: current # Download artifact from Build stage
artifact: drop
- script: echo 'Deploying to staging...'
Pipeline Hierarchy โ Simple
Level
Contains
Think of it as...
Pipeline
Stages
The whole recipe
Stage
Jobs
A chapter (Build, Test, Deploy)
Job
Steps
A section within the chapter
Step
Task or Script
One instruction (run this command)
07๐
YAML Advanced Features
Variables, Conditions, Environments & Approvals
Master these features to build production-grade pipelines โ variable groups linked to Key Vault, conditional stages, environment approvals, and deployment strategies.
Multi-stage YAML pipelines combine build AND deployment in one file. The artifact flows from Build โ Staging โ Production with approval gates between stages.
Templates let you write pipeline logic once and reuse it across all your microservices. Instead of copy-pasting the same Docker+K8s pipeline into 50 repos, you call a template. Change once, all 50 pipelines update.
YAML# extends wraps the ENTIRE pipeline โ teams can only fill parameters
# They CANNOT skip security scans or remove approval gates
# azure-pipelines.yml (team's file โ very simple)
resources:
repositories:
- repository: templates
type: git
name: DevOps/pipeline-templates
extends:
template: enterprise-pipeline.yml@templates
parameters:
appName: 'order-service'
buildTool: 'maven'
deployTo: 'aks-production'
๐ก template vs extends
template inserts reusable steps โ teams can add more. extends wraps the entire pipeline โ teams ONLY fill in parameters, they cannot skip mandatory steps. Use extends when security scans and approvals are mandatory company-wide.
11๐ฆ
Azure Artifacts
Private Package Registry
Artifacts hosts private package feeds. Your CI pipeline publishes packages (NPM, Maven, NuGet), and other pipelines or developers consume them. Like having a private npm registry or Nexus inside Azure DevOps.
az artifacts feed create --name company-packagesCreate a new feed
az artifacts universal publish --feed company-packages --name mylib --version 1.0.0 --path ./distPublish a package
NPM Private Feed
YAML# .npmrc โ point npm to your private feed
registry=https://pkgs.dev.azure.com/myorg/MyProject/_packaging/company-packages/npm/registry/
always-auth=true
# Pipeline step: publish to feed
- task: Npm@1
inputs:
command: 'publish'
publishRegistry: 'useFeed'
publishFeed: 'MyProject/company-packages'
12๐ฅ
User Management & Permissions
Control Access at Every Level
Azure DevOps has a layered permission system: Organization โ Project โ Repository โ Pipeline โ Environment. You can control who can see, edit, build, and deploy at every level. This is critical for enterprise security.
PERMISSIONS# For each Git repository, you can set:
# - Who can push to specific branches
# - Who can create branches
# - Who can force push (should be nobody!)
# - Who can bypass branch policies (emergency only)
# Example: Protect main branch
# Project Settings โ Repos โ Select repo โ Security
# Deny: Force Push to main โ Deny for ALL groups
# Allow: Contribute to main โ Only via pull requests
# Allow: Bypass policies โ Only "Emergency Admins" group
Personal Access Tokens (PATs)
PATs are like passwords for automation and CLI access. They have scoped permissions and expiration dates.
โUser Settings โ Personal Access Tokens โ New Token
โSet scope: only grant minimum permissions needed (e.g., Code: Read)
โSet expiration: 90 days max for security
โUse PAT in Git clone: git clone https://pat@dev.azure.com/org/project/_git/repo
โUse PAT in pipeline service connections for cross-project access
โNEVER share PATs โ each user should have their own
โRotate PATs every 90 days
Environment Approvals (Deployment Permissions)
๐ข
Dev Environment
No approvals. Any contributor can trigger deploy.
๐ก
Staging
1 approver from QA team. Branch filter: release/* only.
๐ด
Production
2 approvers: tech lead + manager. Branch: main only. Business hours only. Exclusive lock (1 deploy at a time).
โ ๏ธ Least Privilege
Give everyone the MINIMUM permissions they need. Developers don't need admin access. Interns should be Readers. Only the DevOps lead should be able to modify production environment approvals.
13๐
Service Connections
Connect to External Services
Service connections authenticate your pipelines to external services โ Azure subscriptions, Docker registries, Kubernetes clusters, AWS, SSH servers. They are centrally managed and scoped to specific pipelines.
Type
Connects To
Best Auth Method
Azure Resource Manager
Azure subscription
Managed Identity (no passwords!) or Service Principal
Docker Registry
ACR, Docker Hub, ECR
Service Principal for ACR, username/password for others
Kubernetes
AKS, EKS, GKE
Kubeconfig or Azure subscription (for AKS)
SSH
Remote Linux servers
SSH key pair
GitHub
GitHub repositories
GitHub App or PAT
Generic
Any REST API
Bearer token or basic auth
โCreate: Project Settings โ Service Connections โ New
โScope: Grant to specific pipelines only (not all pipelines)
โUse Managed Identity when connecting to Azure resources (zero secrets to manage)
โFor production connections, require approval before use
โRotate Service Principal secrets every 90 days
โUse Azure Key Vault for secrets instead of pipeline variables
14๐
Best Practices
Enterprise Azure DevOps Patterns
Pipeline Best Practices
โUse YAML pipelines for everything new โ Classic only for legacy
โStore azure-pipelines.yml in the same repo as your application code
โUse templates for shared build/deploy logic across microservices
โUse extends templates for mandatory security scans and approvals
โVariable groups linked to Azure Key Vault for secrets (auto-rotation)
โMulti-stage pipelines: Build โ Test โ Staging โ Production in one file
โEnvironment approvals with branch filters and deployment windows
โSelf-hosted agents for private network access and faster builds
Security Best Practices
โConnect Azure Active Directory for SSO and MFA
โBranch policies on main: require PR, reviewers, passing build
โFolder-level service connections (team isolation)
โPATs with minimum scope and 90-day expiration
โManaged Identity for Azure connections (no passwords to rotate)
โAudit logs: Organization Settings โ Auditing โ review who changed what
โNever store secrets in pipeline variables โ use Key Vault
โRestrict who can modify production environment approvals
15๐ผ
Interview Questions
30+ Azure DevOps Q&A
Platform & Basics
โ
What is Azure DevOps?
All-in-one DevOps platform by Microsoft: Repos (Git), Boards (Agile), Pipelines (CI/CD), Artifacts (packages), Test Plans. Available as cloud service or on-premises (Azure DevOps Server).
โ
Classic vs YAML pipeline?
Classic: UI-based, not in Git, easy to start. YAML: code-based, version-controlled, reviewable in PRs, recommended for production. Classic Releases are legacy; YAML multi-stage is the future.
โ
What are Branch Policies?
Rules on branches: require PR (no direct push), minimum reviewers, build validation (CI must pass), linked work items, comment resolution. Enforce code quality automatically.
โ
Organization vs Project?
Organization = company level (users, billing, policies). Project = team/product level (repos, boards, pipelines). One org has many projects.
Pipelines & Deployment
โ
What is a deployment job?
Special job type with environment, strategy, and lifecycle hooks. Uses deployment: instead of job:. Supports approvals, deployment history, and rollback tracking.
โ
How do approvals work?
Configured on Environments (not pipelines). When pipeline targets environment \"production\", configured approvers must approve. Pipeline pauses until approval.
โ
What are Variable Groups?
Shared variable collections usable across multiple pipelines. Can be linked to Azure Key Vault for automatic secret rotation. Created in Library section.
โ
template vs extends?
template inserts reusable steps (teams can add more). extends wraps entire pipeline (teams only fill parameters). extends enforces organizational standards โ teams cannot bypass.
Security & Administration
โ
What are Service Connections?
Authenticated links to external services (Azure, K8s, Docker). Centrally managed, scoped to pipelines. Use Managed Identity for Azure to avoid password management.
โ
Self-hosted vs Microsoft-hosted agents?
Microsoft-hosted: managed VMs, fresh each build, no maintenance. Self-hosted: your VMs, access to private networks, persistent tools, faster (no VM spin-up).
โ
What are PATs?
Personal Access Tokens โ scoped authentication tokens for CLI and API access. Each user creates their own. Set minimum permissions and 90-day expiration.