Webhooks and triggers
MS Learn module: Pipeline triggers and webhooks · Learning objectives: trigger CI on events (push, PR, schedule, external webhook), filter which events start a run, and integrate external systems via webhooks.
Overview
CI needs a why — the trigger event — before it does the what. This module covers the full trigger surface across Azure Pipelines and GitHub Actions: source-control events, PR events, schedules, manual dispatches, and webhooks that let external services start a pipeline. Trigger filters (branch, path, label, user) keep runs efficient and correct.
Units / lessons covered
- GitHub Actions
on:events:push,pull_request,schedule,workflow_dispatch, webhook events - Azure Pipelines
trigger:blocks, push/PR triggers, branch & path filters - Filtering:
branches,paths-ignore, label/assignee filters for PRs - Webhooks: how external systems invoke a pipeline / workflow and pass a payload
- Idempotency and default behaviors (no trigger → no auto-run)
Concepts introduced (link to term notes)
Key terms / commands
- Azure Pipelines:
trigger:·push/replace/PRvirtual instance ·branches:·paths-ignore: - GitHub Actions:
on:·push:/pull_request:/schedule:·workflow_dispatch· GitHub webhook events (e.g.repository_event)
Hands-on / what to try
Configure a workflow that runs only on pull_request to main and only when files under src/** change; add a schedule job and verify triggers in the run list. Then register a webhook from another system (e.g. an issue tracker) that launches the same workflow with a payload.
Exam focus
- PR triggers evaluate on open/sync; focus on correct
branches:/paths:filters to avoid duplicate/lost runs. - Schedules run on minutes/CRON independent of source changes — know the difference from push.
- Webhooks are inbound invocation, distinct from polling; payloads may carry the variables.
Related
Path MOC · set-up-ci-with-azure-pipelines · use-github-actions-for-ci · pipeline-run-diagnostics-and-maintenance
📘 Source: Configure triggers · What is a trigger? · GitHub workflow events