Instant Slack alert when an Azure DevOps build fails

By General Input

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.

Integrations

  • Azure DevOps
  • Slack Bot

Type

Agentic Task

Categories

  • Engineering

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.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seatsPause marketing emails to escalated customers, then restore them