如何在 Azure Devops 中使用 OData 获取项目的构建

How to get the Builds for a project using OData in Azure Devops

我正在尝试获取使用 Odata for Azure Devops 的项目的所有构建。但是,我发现该 https://analytics.dev.azure.com/{organization}/{project}/_odata/v3.0-preview/Builds 有一个端点,但在为我的项目尝试相同时,我收到以下错误

{"$id":"1","innerException":null,"message":"Resource not found for the segment 'Builds'.","typeName":"Microsoft.OData.UriParser.ODataUnrecognizedPathException, Microsoft.TeamFoundation.OData.Core","typeKey":"ODataUnrecognizedPathException","errorCode":0,"eventId":0}

此端点是否不再可用。还是我的查询有问题?

Is this endpoint not available anymore. Or is there something wrong with my query?

实体集 Build 已重命名。您可以从我们的 User Voice 论坛查看 this post

名称以 Build 开头的所有实体集和实体属性将重命名为以 PipelineRun 开头。

例如Builds实体集将被称为PipelineRunsBuildId实体属性将被称为PipelineRunId

所以你应该使用的是:https://analytics.dev.azure.com/{organization}/{project}/_odata/v3.0-preview/PipelineRuns。它对我有效:)