简体   繁体   English

如何从 Azure devops 导出管道列表?

[英]How can I export a list of pipelines from Azure devops?

I am relatively new to Azure DevOps.我对 Azure DevOps 比较陌生。 I am documenting the pipelines that currently exist within Azure DevOps and there are hundreds of them.我正在记录 Azure DevOps 中当前存在的管道,其中有数百个。 Is there a way to export the names of all of the pipelines and potentially any other information about them (like pipeline description or environment) into an excel or something similar?有没有办法将所有管道的名称以及有关它们的任何其他信息(如管道描述或环境)导出到 excel 或类似的东西中? I have read only access.我有只读权限。 I have not been able to figure out an easy way to do this and I feel like there must be a better solution than manually copying them one by one.我还没有想出一个简单的方法来做到这一点,我觉得一定有比手动一个一个地复制它们更好的解决方案。

I've looked through questions on stack overflow but none seemed to answer this specific question.我查看了有关堆栈溢出的问题,但似乎没有人回答这个具体问题。

REST REST

Depending on the technology you want to use you can use the for example the REST api of Azure DevOps, for YAML pipelines:根据您要使用的技术,您可以使用例如 Azure DevOps 的 REST api,用于 YAML 管道:

https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/list?view=azure-devops-rest-7.0 https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/list?view=azure-devops-rest-7.0

For the classic pipelines: https://learn.microsoft.com/en-us/rest/api/azure/devops/release/definitions/list?view=azure-devops-rest-7.0&tabs=HTTP对于经典管道: https://learn.microsoft.com/en-us/rest/api/azure/devops/release/definitions/list?view=azure-devops-rest-7.0&tabs=HTTP

PowerShell PowerShell

Or using PowerShell with VSTeam, check out the Getting started here .或者将 PowerShell 与 VSTeam 一起使用,请在此处查看入门。

For (YAML) build:对于(YAML)构建:

https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamBuildDefinition https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamBuildDefinition

Get-VSTeamBuildDefinition -ProjectName Demo | Format-List *

And Classic (release) pipelines:和经典(发布)管道:

https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamReleaseDefinition https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamReleaseDefinition

Get-VSTeamReleaseDefinition -ProjectName demo | Format-List *

This result can than easily opened into Excel with $obj | Export-Excel这个结果可以很容易地用$obj | Export-Excel打开成 Excel $obj | Export-Excel : https://github.com/dfinke/ImportExcel $obj | Export-Excelhttps://github.com/dfinke/ImportExcel

For your scenario, REST API is a good approach.对于您的场景, REST API 是一个很好的方法。

To get all the pipelines from a DevOps Project, you could use: Pipeline-List要从 DevOps 项目获取所有管道,您可以使用: Pipeline-List

This could list all pipelines including pipeline name and pipeline ID.这可以列出所有管道,包括管道名称和管道 ID。

在此处输入图像描述

You could copy the output into an excel and filter your target info.您可以将 output 复制到 excel 并过滤您的目标信息。

在此处输入图像描述

With the above pipeline ID, you could use this REST API: Pipelines-Get to retrieve more info related to this specific pipeline by ID.使用上述管道 ID,您可以使用此 REST API: Pipelines-Get按 ID 检索与此特定管道相关的更多信息。

Variables:变量:

在此处输入图像描述

Repo info:回购信息:

在此处输入图像描述

Environments related API are listed here环境相关 API 列在这里

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 Azure DevOps 管道中的 GitHub 存储库运行文件? - How can I run a file from my GitHub repo in Azure DevOps pipelines? Azure Devops - YAML 发布管道 - 如何使用下拉列表 select 构建管道中的特定工件 - Azure Devops - YAML Release Pipelines - How to select a specific artefact from a build pipeline using a dropdown list 我怎样才能删除 Azure DevOps 旧的构建管道和 Power Shell 的租约 - How can I delete Azure DevOps old build pipelines and there leases with Power Shell 脚本如何访问服务连接? (Azure Devops 管道) - How can a script access Service Connections? (Azure Devops Pipelines) 如何在Azure DevOps管道上批量更改批准者? - How do I change approvers in bulk on Azure DevOps Pipelines? 在 Azure Devops Classic Release Pipelines 中,如何通过单击部署所有管道或使用作业触发所有发布管道(Linux agnt - In Azure Devops Classic Release Pipelines, How can I deploy all pipelines with a single click oruse a job to trigger all release pipelines (Linux agnt Azure DevOps 流水线能否按特定顺序运行? - Can Azure DevOps pipelines be run in a specific order? 如何获取 Azure DevOps Artifact 消费者的列表? - How can I get a list of Azure DevOps Artifact consumers? 如何将 Azure DevOps 服务器存储库与 Azure DevOps 服务管道集成 - How to integrate Azure DevOps Servers repositories with Azure DevOps Services Pipelines 如何在 Azure DevOps Pipelines 中将变量读取为数字? - How to read variable as a Number in Azure DevOps Pipelines?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM