Instant Slack alert when an Azure DevOps build fails

When a pipeline build fails, we post a tight Slack card naming who pushed, the likely cause, and a link to the build so on-call can triage in seconds.

Agentic Task
Azure DevOpsSlack BotEngineeringNotifications & Alerts
PromptCreate

When Azure DevOps sends a Build completed service hook and the build finished with a failed result, run this workflow. Only act on failures; ignore builds that succeeded, were canceled, or partially succeeded.

Start by calling Azure DevOps Get Build with the build id from the event to load the full build record: the pipeline (build definition) name, the overall result and which stage or job failed, the source branch, the requested-for user, the source commit id, and the build's web link.

Then call Azure DevOps Get Build Logs to read the output of the failing step. List the build's logs, find the log for the stage or task that failed, and read the tail of it so you can pull out the actual error message or stack trace.

Next call Azure DevOps Get Commit with the build's source commit id and include the change list, so you can see who pushed the change, the commit message, and which files were modified.

Using everything you gathered, identify the failing stage and reason about the single most likely cause in plain language. Tie the error in the logs to the files that changed in the commit when you can, and name a probable fix area, for example a failing test file, a dependency install step, a lint rule, or a broken database migration.

Finally, send the alert to the engineering channel with Slack Bot Send a Message. Format it as a tight, skimmable card using Slack mrkdwn: a bold headline with the pipeline name and a clear FAILED label, the failing stage, the committer's name, a one line summary of the probable cause and fix area, the branch and short commit id, and a link to the build. Keep it short enough that whoever is on call can triage in seconds without opening the pipeline UI.

Additional information

What does this prompt do?
  • Watches your Azure DevOps pipelines and fires the moment a build finishes with a failed result.
  • Reads the failing step's logs and looks up the commit that triggered the build to work out what broke and who pushed it.
  • Posts a short, skimmable Slack card to your engineering channel with the committer, the likely fix area, and a link straight to the build.
  • Lets whoever is on call start triaging in seconds instead of digging through the pipeline UI.
What do I need to use this?
  • An Azure DevOps organization with the pipelines you want to monitor.
  • A Slack workspace with our bot added to your engineering channel.
  • Azure DevOps set to notify this workflow when a build completes (a built-in Azure DevOps service hook, which we help you point at the workflow).
How can I customize it?
  • Send alerts to one engineering channel, or route different pipelines to different team channels.
  • Change which builds trigger an alert, for example only your main branch or release pipelines.
  • Adjust the card wording or tone, or add a mention for whoever is on call.

Frequently asked questions

Does this only alert on failed builds?
Yes. It only fires when a build finishes with a failed result, so your channel stays quiet unless something actually breaks.
How does it know who to notify?
It looks up the commit that triggered the build and names the person who pushed it, along with the files that changed, so the right engineer sees it first.
Will it tell me what went wrong?
It reads the failing step's output and summarizes the most likely cause in plain language, then points to the area to look at first.
Do I have to open Azure DevOps to see the details?
No. The alert includes a direct link to the build, but the card itself is built to give on-call enough context to start triaging right away.
Can I send alerts to more than one channel?
Yes. You can post to a single engineering channel or split alerts across teams based on which pipeline failed.

Related templates

Daily Braintree declined-payment recovery digest to Slack

Every weekday at 8am, your billing team gets a Slack rundown of yesterday's failed Braintree charges, the revenue at risk, and who to chase first.

Braintree
Slack Bot
Agentic Task
Weekday Azure DevOps sprint standup digest in Slack

Every weekday morning, roll up your sprint's work items into a clear per-person standup summary and post it to your team's Slack channel before you meet.

Azure DevOps
Slack Bot
Agentic Task
Track new Braintree disputes before the deadline slips

Every three hours we scan Braintree for new disputes and chargebacks, open a tracked ticket with a tailored evidence checklist, and alert your team in Slack before the response deadline slips.

Braintree
Zendesk
Slack Bot
Agentic Task
Daily Databricks data health check with Slack alerts

Every weekday morning we check your most important Databricks tables for freshness and data problems, and ping Slack only when something actually looks wrong.

Databricks
Slack Bot
Agentic Task
Monday morning employee breach exposure briefing in Slack

Every Monday, automatically find which employee accounts on your company domain turned up in data breaches and get a plain-English briefing in Slack.

Have I Been Pwned
Slack Bot
Agentic Task
Daily malicious IP threat brief for your security team

Every weekday morning, get a short brief of the internet's most-reported malicious IPs, double-checked against a second source and posted straight to your security Slack channel.

AbuseIPDB
VirusTotal
Slack Bot
Agentic Task

Stop finding out about broken builds too late.

Get a clear Slack alert the moment an Azure DevOps build fails, with the who, the why, and a link to fix it fast.