如何使用 azure devops api 获取 yaml 管道详细信息

时间:2021-06-26 09:11:30

标签: api azure-devops azure-pipelines azure-pipelines-yaml

我正在尝试使用管道 azure devops api 获取构建管道的详细信息,它为经典管道提供了正确的结果。

https://dev.azure.com/{orgname}/{projectId}/_apis/build/Definitions/{buildId}?includeAllProperties=True&includeLatestBuilds=True&api-version=6.0";

在 yaml 管道的情况下的错误我无法获得用 yaml 编写的内容。 我想获取添加为 yaml 的任务详细信息

谢谢

1 个答案:

答案 0 :(得分:0)

使用下面的方法获取管道详细信息(参考 https://docs.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/get?view=azure-devops-rest-6.0

GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}?api-version=6.0-preview.1

这将为您提供管道配置对象的附加属性中的 YAML 文件位置和存储库。