Skip to content
Latchkey

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 test

Gotchas

  • 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

Run this faster and cheaper on Latchkey managed runners. Start free →