Introduction
Azure Pipelines is Microsoft’s CI/CD service — the part of Azure DevOps that builds, tests and deploys your code. If you have used GitHub Actions or Jenkins, the concepts will feel familiar: a pipeline is a definition of stages, jobs and steps, and a run executes it. The difference is the ecosystem: Azure Pipelines integrates with Azure Repos, Azure Boards and Azure Artifacts, and it runs on Microsoft-hosted agents with a generous free tier.
This tutorial builds your first pipeline in YAML, explains the two pipeline types, and covers the free tier honestly — including the limits new organisations hit. You need an Azure DevOps organisation (free to create) and a repository with some code in it. If Azure certifications are your goal, our AZ-401 guide explains where pipelines fit in the current Microsoft certification path.
Version note (28 Nov 2026): Azure DevOps Services is the current name of the cloud service. Exam AZ-401, which covers this material, is still in beta with general availability expected in December 2026.
YAML Pipelines vs Classic Pipelines
Azure Pipelines comes in two types, and choosing between them is the first decision:
- YAML pipelines store the pipeline definition in a file — usually azure-pipelines.yml — versioned with your code, in the same repository. Branches get their own pipelines automatically, changes are reviewed in pull requests, and the pipeline history is the Git history.
- Classic pipelines are built in the web portal’s visual editor: a build pipeline plus a separate release pipeline. They predate YAML and are still supported — Microsoft has not deprecated or retired them — but Microsoft recommends YAML for all new pipelines.
For new work, use YAML. Classic build pipelines can be exported to YAML, but Classic release pipelines cannot — their tasks have to be moved individually — so starting in Classic creates a migration you will eventually have to do. One more detail: creating Classic pipelines is disabled by default for new organisations (since Sprint 226), so on a fresh organisation you may need to enable it in Organisation Settings → Pipelines → Settings before the Classic editor even appears.
Your First YAML Pipeline
Create a file called azure-pipelines.yml in the root of your repository. This example checks out the code, installs dependencies, runs tests and publishes the result:
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: UseNode@1
inputs:
version: '22.x'
- script: npm ci
displayName: 'Install dependencies'
- script: npm test
displayName: 'Run tests'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/test-results.xml'
Three parts to understand. trigger says which branches start the pipeline — here, pushes to main. pool says where it runs — ubuntu-latest is a Microsoft-hosted agent, a fresh virtual machine created for the run and discarded afterwards. steps are the work: tasks (pre-built steps like UseNode@1, with the @1 being the task’s major version) and scripts (plain shell commands). Commit the file, and Azure DevOps offers to create the pipeline from it — the first run starts immediately.
Stages, Jobs and Steps
A pipeline is a hierarchy: stages contain jobs, and jobs contain steps. The example above has one implicit stage and one implicit job. A real pipeline makes them explicit — build, then test, then deploy:
trigger:
- main
pool:
vmImage: ubuntu-latest
stages:
- stage: Build
jobs:
- job: Build
steps:
- script: npm ci
displayName: 'Install dependencies'
- script: npm run build
displayName: 'Build'
- stage: Test
dependsOn: Build
jobs:
- job: Test
steps:
- script: npm test
displayName: 'Run tests'
- stage: Deploy
dependsOn: Test
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
jobs:
- deployment: Deploy
environment: production
strategy:
runOnce:
deploy:
steps:
- script: echo "Deploying to production"
Stages run in order through dependsOn. The Deploy stage adds a condition — it only runs when the tests passed and the branch is main — and uses a deployment job with an environment, which is how Azure DevOps adds approvals and checks: an environment can require a person to approve before the deployment proceeds. That approval gate is the feature that separates a pipeline that deploys from a pipeline that deploys safely.
Variables are the other building block. Define them at the top of the file, in variable groups (shared across pipelines, and the right place for values used by many pipelines), or as secrets in a variable group linked to Azure Key Vault. Never put a password or a key directly in a YAML file — it is in Git, and a secret committed to Git is a compromised secret.
Agents — Microsoft-Hosted vs Self-Hosted
A pipeline runs on an agent: a machine with the agent software installed. There are two kinds.
Microsoft-hosted agents are fresh virtual machines provided by Microsoft, from the predefined Azure Pipelines pool. You pick an image — ubuntu-latest, windows-latest or macOS-latest — and Microsoft creates a clean VM for each job, runs it, and destroys it. The images are updated regularly: on Windows, windows-2025 (Windows Server 2025 with Visual Studio 2022) is currently windows-latest, and windows-2025-vs2026 (Windows Server 2025 with Visual Studio 2026, generally available 29 September 2026) becomes windows-latest in the coming weeks. Windows Server 2019 images were retired on 31 December 2025. Hosted agents are the right default: no maintenance, no patching, a clean machine every time.
Self-hosted agents are machines you provide and maintain — a server, a VM, or a container — with the agent software installed. You use them when you need specific software, access to an internal network, or more control than a hosted image offers. They cost more of your time and less of Microsoft’s money, which is the trade-off.
The Free Tier — What You Actually Get
Azure DevOps has a free tier, but its limits surprise new users, so here they are plainly. For private projects: 1 free Microsoft-hosted parallel job, up to 60 minutes per job, and 1,800 minutes (30 hours) per month, plus 1 free self-hosted parallel job with unlimited minutes. Extra parallel jobs cost $40 per month each for Microsoft-hosted and $15 per month each for self-hosted, with no monthly minute limit on paid jobs. New organisations can have at most 25 Microsoft-hosted parallel jobs.
Two caveats matter. First, the free Microsoft-hosted grant must be enabled, and the organisation must be linked to a valid Azure subscription; for new organisations the free grant for certain private projects is temporarily disabled and has to be requested, which can take several business days. If your first pipeline sits in a queue saying no agents are available, that is usually why. Second, do not rely on the old “10 free jobs for public projects” figure: public projects are retired — you can no longer create new public projects, and existing ones keep their grants only until they convert to private in 2027.
For a learner, 1,800 minutes a month is plenty: it is 30 hours of builds, and a typical tutorial pipeline runs for two or three minutes. The limit that bites first is the 60-minute per-job cap on the free tier — a slow test suite or a large build will hit it before the monthly allowance runs out. Split long work into parallel jobs, or cache dependencies, rather than paying for a second parallel job.
Azure Pipelines vs GitHub Actions vs Jenkins
The three CI/CD tools on this site cover the same ground differently. Our GitHub Actions Tutorial is the simplest starting point and the best fit for open-source projects on GitHub. Our Jenkins Tutorial is the self-hosted, infinitely customisable option — and the one that needs the most maintenance. Azure Pipelines sits between them: managed like GitHub Actions, enterprise-featured like Jenkins, and deeply integrated with Azure.
Choose Azure Pipelines when your code and your cloud are both in the Microsoft ecosystem, when you need approval gates and environments for production deployments, or when your employer already uses Azure DevOps. Choose GitHub Actions when your code lives on GitHub and you want the lowest friction. Choose Jenkins when you need to run everything on your own infrastructure. The YAML you learn in one transfers to the others — triggers, jobs, steps and secrets are the same ideas with different spelling.
Common Beginner Mistakes
- Committing secrets to azure-pipelines.yml. Use variable groups and Key Vault. A pipeline file is in Git, and Git remembers everything.
- Using `windows-latest` or `ubuntu-latest` without knowing what they point at. The *-latest labels move to new images over time. Pin a specific image (ubuntu-24.04, windows-2025) for pipelines that must be reproducible, and let *-latest move only for pipelines you watch closely.
- One giant stage instead of stages. Build, test and deploy as separate stages with dependsOn — so a failed test never triggers a deploy, and the pipeline history shows which stage failed.
- No approval on the production environment. A pipeline that deploys to production on every merge is a pipeline that deploys every mistake. Environments with approvals cost one click and prevent the worst kind of incident.
- Forgetting the free grant needs enabling. If jobs queue forever on a new organisation, check the parallel jobs settings and whether the free grant has been requested — it is the most common first-week problem.
FAQ
Is Azure DevOps free?
The core services are free to start: Azure Repos, Boards and Pipelines have free tiers. Pipelines gives 1 free Microsoft-hosted parallel job with 1,800 minutes a month for private projects, and 1 free self-hosted job with unlimited minutes.
What is the difference between Azure Pipelines and GitHub Actions?
Both are Microsoft CI/CD products. GitHub Actions is built into GitHub and simplest for GitHub-hosted code. Azure Pipelines is part of Azure DevOps, with environments, approval gates and release management aimed at enterprise teams. The YAML concepts are nearly identical.
Are Classic pipelines deprecated?
No. Microsoft recommends YAML for new pipelines and has disabled Classic creation by default for new organisations, but Classic pipelines are still supported and existing ones keep working.
Can I run Azure Pipelines without Azure?
Yes. Azure DevOps is a separate service from the Azure cloud — you can build and deploy to AWS, on-premises servers, or any other target. The hosted agents are just machines; what they deploy to is your choice.
What is AZ-401, and does it cover pipelines?
AZ-401 is the exam for the Microsoft Certified: Agentic DevOps Engineer Expert credential, replacing AZ-400 (which retires 1 February 2027). It covers Azure DevOps, GitHub and agentic DevOps practices. It is in beta as of November 2026, with general availability expected in December 2026 — see our AZ-401 guide for the full picture.
Conclusion
Azure Pipelines rewards the same habits as every other CI/CD tool: define the pipeline in code, split it into stages, gate production with an approval, and keep secrets out of Git. The free tier is enough to learn on — one parallel job, 1,800 minutes a month — and the YAML you write here works the same way in GitHub Actions and Jenkins, so the skill transfers.
From here, connect the pipeline to something real: deploy the application it builds to Azure App Service or a Kubernetes cluster, add the approval gate on the production environment, and read our AZ-401 guide if you want the certification that proves you can do it.
Sources checked 28 Nov 2026: Microsoft Learn — Azure Pipelines get started (YAML vs Classic; Classic creation disabled by default for new organisations since Sprint 226; Classic not stated as deprecated); Microsoft-hosted agents page (Azure Pipelines pool; windows-2025-vs2026 GA 29 Sep 2026; windows-2025 currently windows-latest; Windows Server 2019 retired 31 Dec 2025); concurrent jobs and pricing pages (1 free Microsoft-hosted parallel job, 60 min/job, 1,800 min/month; $40/month extra hosted, $15/month extra self-hosted; public projects retired); Microsoft Learn AZ-401 pages (exam and certification still in beta; GA expected Dec 2026; passing score 700). Linux/macOS hosted-image version labels were not directly verified on the official page in this check — the article uses the *-latest labels only. External references: Azure Pipelines documentation · Azure DevOps pricing.
—


