Impossible to get the latest build using Azure Dev

2019-08-01 23:36发布

I'm trying to get it using this GET request:

https://dev.azure.com/LumiaWOA/Boot%20Shim/_apis/build/latest/UEFI%20PreLoader Build?branchName=msm8994-pcie&api-version=5.0-preview.1

All I get is this response:

{
    "$id": "1",
    "innerException": null,
    "message": "Cannot serialize type Microsoft.TeamFoundation.Build.WebApi.Build, because the security requirements are not met  Namespace:33344d9c-fc72-4d6f-aba5-fa317101a7e9, RequestedPermissions:1, DataspaceIdentifier: 328eea29-7d2f-4cdf-b928-d58c53d8f29d",
    "typeName": "System.InvalidOperationException, mscorlib",
    "typeKey": "InvalidOperationException",
    "errorCode": 0,
    "eventId": 0
}

I don't understand why I'm getting that error, since the builds are public for everyone: Please, check it: https://dev.azure.com/LumiaWoA/Boot%20Shim/_build?definitionId=3

But it shows this error.

1条回答
来,给爷笑一个
2楼-- · 2019-08-02 00:40

Based on my test, I also can reproduce the issue as you mentioned. From the response error message 500. It is not relate to authentication. It seems there is something wrong with Azure Devops API from server side. I recommend that you could give your feedback to azure devops.

enter image description here

My workaround is that we could use the list build ways with $top =1 to get the latest build. For more information please refer to List build API.

https://dev.azure.com/{orgName}/{projectNam}/_apis/build/builds?definitions=defintionId&$top=1&api-version=5.0-preview.5
查看更多
登录 后发表回答