How to get a pipeline run error with Azure runs REST API

Viewed 317
1 Answers

You can use the REST API "Timeline - Get" to list the issues (error and warning) associated with a run.

Note: This API can only list the first 10 issues. If the run has more than 10 issues, the rest will not be listed in the response. To get the complete issues, you can use the API "Builds - Get Build Log" or "Logs - Get" to get the complete logs that contains the complete issues.

[UPDATE]

The buildId is same as the runId, and you can find it from the URL of the pipeline (build) run.

The timelineId is not required in the API request, you can use the request URI like as below.

GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/timeline/?api-version=6.0
Related