Search code examples
azureazure-devopsazure-rest-api

Is there a way to get the live logs of a running pipeline using Azure REST API?


I am running a build pipe line in azure that is having multiple tasks. But I have a requirement to get logs using rest API calls after triggering pipeline. I used Builds-Get Build Logs, but it listing only completed task logs and not listing ongoing task log. Is there any mechanism available to get ongoing task logs/live logs?


Solution

  • Is there a way to get the live logs of a running pipeline using Azure REST API?

    I am afraid there is no such mechanism available to get ongoing task logs/live logs.

    As we know, the Representational State Transfer (REST) APIs are service endpoints that support sets of HTTP operations (methods), which provide create, retrieve, update, or delete access to the service's resources.

    The task is executed inside the agent, and the result of the execution be passed back to azure devops only after a task is completed. So, HTTP operations (methods) are triggered only when the task is completed and the results are returned, and then we could use the REST API to get the results.

    So, we could not use the Azure REST API to get ongoing task logs/live logs. This is limited by the azure devops design pattern.

    Hope this helps.