本文介绍了无法使用Azure DevOps API获取最新版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用此GET请求获取它:

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
}

我不明白为什么会收到该错误,因为该版本对每个人都是公开的:请检查一下: https://dev.azure.com/LumiaWoA/Boot%20Shim/_build?definitionId=3

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

但是它显示了此错误.

推荐答案

根据我的测试,我也可以像您提到的那样重现该问题.来自响应错误消息500.它与身份验证无关.服务器端的Azure Devops API似乎有问题.我建议您可以将您的反馈提供给天蓝色的开发人员.

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.

我的解决方法是我们可以将列表构建方式与$top =1一起使用以获取最新的构建.有关更多信息,请参阅列出构建API .

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

这篇关于无法使用Azure DevOps API获取最新版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 15:57