How to Set Up a Monorepo Pipeline in Azure Pipelines
Azure Pipelines handles monorepos with per-component pipelines, each with its own trigger.paths filter.
The cleanest model is one pipeline per component, each triggered only by its own path filter. They live in separate YAML files referencing the same repo.
A component pipeline with a path filter
This pipeline runs only when files under its component change; create one like it per component.
packages/api/azure-pipelines.yml
# packages/api/azure-pipelines.yml
trigger:
branches:
include: [main]
paths:
include:
- packages/api/*
jobs:
- job: api
pool: { vmImage: 'ubuntu-latest' }
steps:
- script: |
cd packages/api
npm ci && npm testGotchas
- Each pipeline is registered separately in Azure DevOps pointing at its own YAML path - the path filter alone does not create it.
- Path filters apply to CI/PR triggers, not scheduled runs; scheduled nightly builds run regardless of paths.
- A wildcard is needed (
packages/api/*); a bare folder name does not match recursively the way you expect.
Related guides
How to Set Up a Monorepo Pipeline in GitHub ActionsSet up a monorepo pipeline in GitHub Actions that builds only changed packages, using a change-detection job…
How to Run a Pipeline Only on Changed Paths in Azure PipelinesRun an Azure Pipeline only when certain files change using trigger paths include/exclude, and gate stages wit…