0
votes

Any idea why this method does not work:

GET https://{instance}/DefaultCollection/{project}/_apis/build/builds/{buildId}/logs?api-version=2.0

I am able to get build definition, etc. but when I try to get log based on this build ID, I'm getting this error:

{"$id":"1","innerException":null,"message":"This API is only applicable to logs stored in the file container.","typeName":"Microsoft.TeamFoundation.Build.WebApi.InvalidLogLocationException, Microsoft.TeamFoundation.Build2.WebApi, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","typeKey":"InvalidLogLocationException","errorCode":0,"eventId":3000}

1

1 Answers

1
votes

I'm not sure if this is a supported API, but the following works for me.

VSTS: https://{instance}.visualstudio.com/{project}/_apis/build/builds/{buildid}/logs?$format=zip

TFS: http://{instance}/Collection/{project}/_apis/build/builds/81590/logs?$format=zip