Skip to main content
In this guide, we’ll demonstrate how to configure trigger rules in Azure Pipelines using a Blazor WebAssembly application. You’ll learn to automate your CI/CD workflows with continuous integration, pull request validation, scheduled runs, tag-based triggers, and pipeline-resource dependencies.

Table of Contents

  1. Basic Trigger Types
  2. Refining CI Triggers with Branch & Path Filters
  3. Example: Updating launchsettings.json
  4. Pull Request Triggers
  5. Scheduled Triggers
  6. Tag-Based Triggers
  7. Pipeline Resource Triggers
  8. Managing YAML in Azure Repos
  9. Summary
  10. Links and References

Basic Trigger Types

Azure Pipelines supports several trigger rules to automate builds and deployments. The key types are:

1. Continuous Integration (CI)

A CI trigger automatically starts a build when code is pushed to specified branches.

2. Pull Request (PR)

PR triggers validate changes in pull requests before they’re merged into the target branch.

3. Scheduled

Schedule pipelines using cron syntax to run at regular intervals.

4. Tag-Based

Trigger builds when Git tags matching a pattern are pushed.

5. Pipeline Resource

Chain pipelines by triggering one when another succeeds.

Refining CI Triggers with Branch & Path Filters

By default, a CI trigger on master fires for any change. You can target multiple branches and restrict file paths:
This configuration builds on commits to master or any feature/* branch only when files under Properties/ change (ignoring Markdown updates).
The image shows an Azure DevOps Pipelines interface with a recently run pipeline for a project named "WeatherApp." The pipeline was set up for continuous integration and ran 20 minutes ago.

Example: Updating launchsettings.json

Let’s make a change inside the monitored Properties folder:
Then commit and push your changes:
Since the file is in Properties/, the CI pipeline triggers again.

Pull Request Triggers

To enforce code quality before merging, add a PR trigger in your YAML:

Testing Feature Branch Builds

This push invokes the CI trigger on your feature branch.

Validating Pull Requests

When you open a PR against master in Azure Repos, the pipeline runs against the merged commit, ensuring no regressions slip through.
The image shows an Azure DevOps Pipelines interface for a project named "WeatherApp," displaying a recently run pipeline with details of a merged pull request.
Use PR triggers to run tests, deploy to staging, or produce artifacts before merging.

Scheduled Triggers

Nightly or hourly builds help catch issues that arise over time:
The setting always: true ensures the pipeline runs regardless of code changes.

Tag-Based Triggers

Create a build when you tag a release (e.g., v1.0.0), but only if source or test files changed:

Pipeline Resource Triggers

Connect pipelines to build downstream artifacts automatically:
This ensures your Blazor WebAssembly app always builds with the latest API changes.

Managing YAML in Azure Repos

Maintaining azure-pipelines.yaml in source control provides:
  • Versioned build definitions
  • Easier peer review and auditing
  • Consistent CI/CD behavior across environments
You can also define or override triggers via the Azure DevOps web interface, but YAML-as-code offers transparency and repeatability.

Summary

By configuring CI, PR, scheduled, tag-based, and pipeline-resource triggers, you can:
  • Accelerate feedback loops
  • Enforce quality gates before merges
  • Automate nightly or periodic builds
  • Trigger releases on semantic version tags
  • Orchestrate multi-pipeline workflows
Tailor these trigger rules to match your project’s requirements and boost your DevOps maturity.

Watch Video