I came across two REST APIs but not sure will fetch the deployment logs.
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}/logs?api-version=5.1-preview.2
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}/environments/{environmentId}/deployPhases/{releaseDeployPhaseId}/tasks/{taskId}/logs?api-version=5.1-preview.2
transfer-encoded
format. How to retrieve the real data from the body in NodeJS?releaseDeployPhaseId
and taskId
. I didn't get those information in Azure DevOps Release Pipeline portal.Can anyone help me on this? Thanks in advance!
According to the test results, it is currently only possible to obtain the plain text release log through the second API.
You can get deployPhaseId
and taskId
according to the api provided by Shayki, deployPhaseId
refers to the agent job id in the stage. The shortcoming of the second rest api is that it cannot get the complete release log, it can only get the log of one task.
If you do not get the release log through the rest api, you can download the complete log from the web ui through the Download all logs
button.
Regarding the first rest api, I tested the url in the browser: https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}/logs
, it automatically downloaded a log.zip file to the local. Test in postman, it returned unrecognizable code.