Azure DevOps Pipeline Failure Notifier
Triggered on Azure DevOps build failure. Looks up solution/project metadata, posts a Teams alert to the dev channel with pipeline name, branch, and failure link, and creates a Planner task assigned to the repo owner.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
FlowLibs - ADO Pipeline Failure Notifier is a scheduled Power Automate Cloud Flow that monitors Azure DevOps build pipelines for failures. When failed builds are detected, the flow posts a detailed alert to a Microsoft Teams channel and creates a Planner task for investigation — ensuring no build failure goes unnoticed.
Use Case
DevOps teams need immediate visibility when CI/CD pipelines fail. This flow automates the notification workflow by polling Azure DevOps for failed builds, retrieving build timeline details for context, posting a rich Teams alert, and creating a Planner task so the failure investigation is tracked and assigned.
The flow is ideal for teams that:
- Polling Azure DevOps hourly for failed builds in the last 24 hours
- Retrieving build timeline details for root cause context
- Posting a rich Teams message with pipeline name, branch, repository, requester, and a direct link to the build
- Creating a Planner task so the failure investigation is tracked and assigned
Flow Architecture
Recurrence Check For Build Failures
RecurrenceRuns every 1 hour to poll Azure DevOps for failed builds.
Init varAdoOrganization
Initialize VariableReads the `flowlibs_AdoOrganization` environment variable. Runs in parallel with steps 2–6.
Init varAdoProject
Initialize VariableReads the `flowlibs_AdoProject` environment variable. Runs in parallel with steps 1, 3–6.
Init varTeamsGroupId
Initialize VariableReads the `flowlibs_TeamsGroupId` environment variable. Runs in parallel with steps 1–2, 4–6.
Init varTeamsChannelId
Initialize VariableReads the `flowlibs_TeamsChannelId` environment variable. Runs in parallel with steps 1–3, 5–6.
Init varPlannerGroupId
Initialize VariableReads the `flowlibs_PlannerGroupID` environment variable. Runs in parallel with steps 1–4, 6.
Init varPlannerPlanId
Initialize VariableReads the `flowlibs_PlannerPlanID` environment variable. Runs in parallel with steps 1–5.
Get Recent Failed Builds
ADO HttpRequest (connector)`GET {project}/_apis/build/builds?statusFilter=completed&resultFilter=failed&minTime={utcNow-24h}` — returns failed builds from the last 24 hours.
Parse Build Results
Parse JSONExtracts build id, buildNumber, result, sourceBranch, requestedFor, definition, repository, finishTime, and web link from the API response.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_AdoOrganization | String | <configure> | Azure DevOps organization name (e.g., `your-org`). |
| flowlibs_AdoProject | String | <configure> | Azure DevOps project name within the organization. |
| flowlibs_TeamsGroupId | String | <configure> | Microsoft Teams team/group GUID for the alert channel. |
| flowlibs_TeamsChannelId | String | <configure> | Teams channel ID within the group where alerts will be posted. |
| flowlibs_PlannerGroupID | String | <configure> | M365 Group ID that owns the Planner plan. |
| flowlibs_PlannerPlanID | String | <configure> | Planner plan GUID for investigation tasks. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Azure DevOps | shared_visualstudioteamservices | HttpRequest (Query failed builds) HttpRequest (Get build timeline) |
| Microsoft Teams | shared_teams | PostMessageToConversation (Post failure alert to channel) |
| Planner | shared_planner | CreateTask_V3 (Create investigation task) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Change recurrence interval
- Adjust the recurrence trigger frequency — for example, every 15 minutes for critical pipelines that need faster failure detection.
- Scope to specific pipeline definitions
- Add an OData $filter to the ADO API call to limit alerts to a subset of pipelines (e.g., only release pipelines or a specific definitionId).
- Filter by branch
- Add a Condition action after Parse JSON to only alert on specific branches such as main or release/*, reducing noise from feature-branch failures.
- Include build timeline error details in Teams alert
- Use the Get Build Timeline output to surface failed step names and error messages directly in the Teams card for faster triage.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.0124-hour lookback window
Used in the `minTime` query parameter to the ADO Builds API to limit results to the last 24 hours.
EXPR.02Build link
Direct URL to the failed build in Azure DevOps — included in the Teams alert.
EXPR.03Planner task title
Builds a descriptive Planner task title from the pipeline definition name and build number.
EXPR.04ADO API path
Composes the full Azure DevOps Builds API path with the 24-hour lookback filter.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.