Skip to content
  • English Deutsch

benjamin-abt.com

Performance is a feature | Cloud - AI - Azure - .NET - Sustainability

  • Home
  • Blog
  • Portfolio
    • Overview
    • Workshops & Training
    • Publications
  • Contact
  • Home
  • Blog

Azure DevOps Path Exclude Trigger: Comparing 'docs', 'docs/', 'docs/**' and 'docs/**/*'

Azure DevOps Path Exclude Trigger: Comparing 'docs', 'docs/', 'docs/**' and 'docs/**/*'
July 17, 2025 2 min read BEN ABT
Azure DevOps CI/CD Pipelines

When configuring path-based triggers or excludes in Azure DevOps pipelines, the pattern you use can have a significant impact on which files or folders will trigger a build. There are subtle but important differences between the patterns docs, docs/, docs/** and docs/**/*.

And I often see wrong trigger definitions.

Pattern Overview

docs

Matches only the file or folder named docs at the root. Does not match files inside the folder. Rarely useful for excludes.

  • docs (folder itself) → excluded
  • docs/readme.md → not excluded
  • docs/guide/intro.md → not excluded

docs/

Matches the folder named docs and everything inside it, recursively. Equivalent to docs/** in most cases.

  • docs/readme.md → excluded
  • docs/guide/intro.md → excluded
  • docs/assets/image.png → excluded
  • docs/guide/advanced/usage.md → excluded
  • docs/ (folder itself) → excluded

docs/**

Matches all files and folders under docs at any depth, including the folder itself. Excludes everything recursively.

  • docs/readme.md → excluded
  • docs/guide/intro.md → excluded
  • docs/assets/image.png → excluded
  • docs/guide/advanced/usage.md → excluded
  • docs/ (folder itself) → excluded

docs/**/*

Matches all files (not folders) at any depth under docs. Excludes all files recursively, but not the folder itself.

  • docs/readme.md → excluded
  • docs/guide/intro.md → excluded
  • docs/assets/image.png → excluded
  • docs/guide/advanced/usage.md → excluded
  • docs/ (folder creation/deletion) → not excluded

Summary Table

Changed File/FolderExcluded by docsExcluded by docs/Excluded by docs/**Excluded by docs/**/*
docsYesYesYesNo
docs/readme.mdNoYesYesYes
docs/guide/intro.mdNoYesYesYes
docs/assets/image.pngNoYesYesYes
docs/guide/advanced/usage.mdNoYesYesYes

Recommendation

Use docs/ or docs/** if you want to exclude all changes within the docs folder and any subfolders, including folder changes. Use docs/**/* if you want to exclude all files at any depth, but not changes to the folder itself. The plain docs pattern is rarely useful for excludes.

Example YAML

YAML
1trigger:
2  branches:
3    include:
4      - main
5  paths:
6    exclude:
7      - docs/**      # Excludes all changes in docs and subfolders (including folders)
8      # - docs/**/*  # Excludes all files in docs and subfolders, but not the folder itself

Related articles

.NET NuGet Trusted Publishing with GitHub Actions

Mar 10, 2026 - 15 min read

.NET NuGet Trusted Publishing with GitHub Actions

Publishing NuGet packages has traditionally required one uncomfortable compromise: a long-lived API key had to exist somewhere in the …

Use SSH for Git Authentication in Azure DevOps

Aug 20, 2025 - 5 min read

Use SSH for Git Authentication in Azure DevOps

If you work with Azure DevOps Git repos, SSH is often the simplest, most secure and most policy‑friendly way to authenticate. Many …


BEN ABT

BEN ABT

Ben is Chief Engineering Officer and Principal Software Engineer at Medialesson.de, with a strong focus on .NET and Microsoft Azure. In his professional role, he designs and builds highly scalable platforms for hybrid and cloud-based scenarios. He also advises companies and C-levels on migrating to the sovereign cloud.

He runs myCSharp.de, the largest and most active German-speaking C# community forum, actively contributes to both his own and external open-source projects and regularly shares his knowledge through his blog, at community events, conferences and as a writer for technical magazines.

Let's Work Together

Looking for an experienced Platform Architect or Engineer for your next project? Whether it's cloud migration, platform modernization or building new solutions from scratch - I'm here to help you succeed.

New Platforms

Modernization

Training & Consulting

Contact Me
X Facebook LinkedIn WhatsApp
Back Next Blog Post

Open for work!

Contact Me
BEN ABT BEN ABT Software Engineer · Microsoft MVP Passionate about .NET, Azure, performance optimization and sustainable software engineering.

Medialesson GmbH Logo

Microsoft MVP Logo

Recent posts

View all
Stop Using nginx as Your Default Static File Server in Docker

Stop Using nginx as Your Default Static File Server in …

Oct 24, 2026
Containerizing .NET in 2026 Without a Dockerfile

Containerizing .NET in 2026 Without a Dockerfile

Oct 20, 2026
Problem Details in ASP.NET Core and .NET 11

Problem Details in ASP.NET Core and .NET 11

Oct 5, 2026
Resilience in .NET with Microsoft.Extensions.Resilience

Resilience in .NET with Microsoft.Extensions.Resilience

Sep 21, 2026
What Matters in ASP.NET Core 11

What Matters in ASP.NET Core 11

Sep 14, 2026

Tags

.NET (192) Csharp (96) ASP.NET Core (48) Azure (41) DevOps (17) Docker (14) Microsoft (14) EF Core (11) Microsoft MVP (11) AI (10) GitHub (10) GitHub Copilot (10) ASP.NET (9) Security (9) Synology (9) Architecture (8) Raspberry (8) Azure Functions (7) Cloudflare (7) Bicep (6)
benjamin-abt.com

About BEN

Benjamin Abt is a Software Engineer, Platform Architect and Microsoft MVP specializing in .NET, Azure, cloud architecture, performance optimization and sustainable software development.

Connect

  • Follow me on GitHub
  • Follow me on LinkedIn
  • Follow me on Mastodon
  • Microsoft MVP profile
  • Follow SchwabenCode on GitHub
  • Follow me on X

Quick Links

  • Portfolio
  • Blog
  • Workshops & Training
  • Publications
  • Get in Touch
  • Sitemap
Open for Work

© Copyright Benjamin Abt & SchwabenCode | 2011 - 2026

Content licensed under CC BY 4.0 unless otherwise noted.

  • Impressum
  • Privacy
  • Contact