Investigate Azure DevOps (AZDO) pipeline build failures by fetching logs, downloading artifacts, and analyzing .binlog files to find the root cause of errors. Use this when users share an AZDO build URL, a GitHub PR URL, or ask about a failing pipeline, build errors, or CI failures.
Investigate Azure DevOps (AZDO) pipeline build failures by fetching logs, downloading artifacts, and analyzing .binlog files to find the root cause of errors. Use this when users share an AZDO build URL, a GitHub PR URL, or ask about a failing pipeline, build errors, or CI failures.
AZDO Build Investigator
Given a build URL or GitHub PR URL, fetch run details, find failed jobs/tasks, download logs and .binlog artifacts, and produce a summarized root-cause error trail.
Prerequisites
The tools below are required as follows: az is always required; gh is required only for GitHub PR URLs; binlogtool is required only for .binlog analysis. If any required tool is missing for the current task, stop immediately, show the relevant setup link, and do NOT install on the user's behalf.
Filter bucket == "fail". Each has a link with the AZDO build URL. Multiple failures → ask user which to investigate. No failures → report passing/in-progress.
Extract {org}, {project} (may be a GUID — that's fine), {buildId}, and the full {orgUrl} (either https://dev.azure.com/{org} or https://{org}.visualstudio.com). Use {orgUrl} consistently in all subsequent az commands.
2. Get Build Overview
az pipelines runs show --id {buildId} --org {orgUrl} --project {project}
Check the issues array first — it often contains the root cause directly.
4. Fetch Full Logs (if needed)
Get log URLs from failed timeline records, then fetch by log ID:
# The logs endpoint returns raw text; save to a file instead of requesting JSON
az devops invoke --area build --resource logs --route-parameters project={project} buildId={buildId} logId={logId} --org {orgUrl} --project {project} --out-file "build-{buildId}-log-{logId}.log"
5. Check for .binlog Artifacts
az pipelines runs artifact list --run-id {buildId} --org {orgUrl} --project {project}
Look for artifact names containing binlog, msbuild, or build-log.