如何通过 Rest API 获取 AzureDevOps 构建变量信息?

How can I get AzureDevOps build variables information through the Rest API's?

我有一个工具 aztr 可以总结 Azure Build/Release 管道测试结果。最近提出了一个要求,即保存传入的变量信息和摘要信息以供工具外部使用(例如 csv 文件)。

现在在发布管道方面 Release API provides all the details about the variables passed into the Release. I want the same functionality to be available on the Build side as well but the Build API 不提供该功能。是否有不同的 API,我需要使用它来获取传递到构建中的变量?

感谢您的回复。

我们可以通过这个 API

列出自定义构建变量
GET https://dev.azure.com/{organization}/{project}/_apis/build/definitions/{definitionId}?api-version=6.0

此外,它们是变量中的一些预定义变量,它们是DevOps Services system variables,我们无法通过此列出它们api。

结果: