You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The note states Azure Repos Git doesn't use YAML pr: triggers; ensure this is clearly scoped so users on GitHub/Bitbucket Cloud don't remove their pr: blocks by mistake. Consider an explicit warning callout.
# NOTE for Azure Repos Git:# Azure Repos does not honor YAML pr: triggers. Configure Build Validation# via Branch Policies instead (see note below). You can safely omit pr:.
Verify the exact Azure DevOps navigation terms (Project Settings → Repositories → Branches → Branch Policies) and that "Build Validation" and "Required" naming matches current UI.
1. Go to Project Settings → Repositories → Branches.
2. Select the target branch and open Branch Policies.
3. Under Build Validation, add a policy:
- Select the PR Agent pipeline (the `azure-pipelines.yml` above).
- Set it as Required.
4. Remove the `pr:` section from your YAML (not needed for Azure Repos Git).
This distinction applies specifically to Azure Repos Git. Other providers like GitHub and Bitbucket Cloud can use YAML-based PR triggers.
Removing the YAML pr: section in the main sample makes it Azure Repos–specific and will disable PR runs for GitHub/Bitbucket users who copy it verbatim. Present two clearly separated configurations: one for Azure Repos (Build Validation, no pr:) and another for GitHub/Bitbucket Cloud (retain YAML pr: triggers), with an upfront callout to prevent misconfiguration.
```yaml# Opt out of CI triggerstrigger: none# NOTE for Azure Repos Git:# Azure Repos does not honor YAML pr: triggers. Configure Build Validation# via Branch Policies instead (see note below). You can safely omit pr:.stages:
- stage: pr_agent... (clipped 56 lines)
Solution Walkthrough:
Before:
```markdown## Azure DevOps Pipeline
Add the following file to your repository:
```yamltrigger: none# NOTE for Azure Repos Git:# Azure Repos does not honor YAML pr: triggers.# Configure Build Validation instead...stages:
...
Azure Repos Git PR triggers and Build Validation
Azure Repos Git does not use YAML pr: triggers...
...
This distinction applies specifically to Azure Repos Git. Other providers like GitHub and Bitbucket Cloud can use YAML-based PR triggers.
After:
```markdown## Azure DevOps Pipeline
Configuration depends on your Git provider.
### For GitHub / Bitbucket Cloud
Use the following configuration with a `pr` trigger:
```yamltrigger: nonepr:
branches:
include: ['*']stages:
...
For Azure Repos Git
Use Build Validation and the following YAML (without a pr trigger):
trigger: nonestages:
...
Instructions for setting up Build Validation...
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a major flaw where the main example only works for Azure Repos, potentially breaking the setup for GitHub/Bitbucket users. Providing separate, complete examples significantly improves documentation clarity and prevents user error.
High
Possible issue
Fix inaccurate PR trigger guidance
Revise to state that Azure Repos Git supports YAML pr: triggers and present Build Validation as an alternative. Also correct the provider note: pr: triggers are supported for Azure Repos Git and GitHub, while Bitbucket Cloud PR triggers are not supported in Azure Pipelines.
### Azure Repos Git PR triggers and Build Validation
-Azure Repos Git does not use YAML `pr:` triggers for pipelines. Instead, configure Build Validation on the target branch to run the PR Agent pipeline for pull requests:+Azure Repos Git supports YAML `pr:` triggers. You can either:+- Define `pr:` in your `azure-pipelines.yml` to run on pull requests, or+- Configure Branch Policies (Build Validation) on the target branch to run the pipeline for PRs.+To set up Build Validation:
1. Go to Project Settings → Repositories → Branches.
2. Select the target branch and open Branch Policies.
3. Under Build Validation, add a policy:
- Select the PR Agent pipeline (the `azure-pipelines.yml` above).
- Set it as Required.
-4. Remove the `pr:` section from your YAML (not needed for Azure Repos Git).+4. If you use Build Validation, remove the YAML `pr:` section (or disable it) to avoid duplicate runs.-This distinction applies specifically to Azure Repos Git. Other providers like GitHub and Bitbucket Cloud can use YAML-based PR triggers.+Provider notes:+- YAML `pr:` triggers are supported for Azure Repos Git and GitHub.+- Bitbucket Cloud PR triggers are not supported by Azure Pipelines; use CI triggers on push instead.
Apply / Chat
Suggestion importance[1-10]: 9
__
Why: The suggestion corrects a significant factual error in the documentation regarding Azure Repos Git's support for YAML pr: triggers, and also clarifies an inaccuracy about Bitbucket Cloud support, preventing user confusion and misconfiguration.
High
Update
Author self-review: I have reviewed the PR code suggestions, and addressed the relevant ones.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
fixes: #2015
PR Type
Documentation
Description
Update Azure DevOps pipeline configuration instructions
Add Build Validation setup guide for Azure Repos Git
Remove YAML pr: triggers for Azure Repos compatibility
Clarify differences between Azure Repos and other providers
Diagram Walkthrough
File Walkthrough
azure.md
Update Azure DevOps pipeline setup instructionsdocs/docs/installation/azure.md
pr:trigger configuration section