我需要此ID,但似乎无法在线找到它吗?
documentation仅将其称为系统变量。
上下文: 我有多个项目,我想在CI期间确定一个项目,以便它可以运行另一个存储库中托管的Powershell脚本。
答案 0 :(得分:1)
您可以使用REST Api获取所有团队项目的ID:
https://dev.azure.com/{organization}/_apis/projects?api-version=5.0-preview.3
结果:
{
"count": 3,
"value": [
{
"id": "eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
"name": "Fabrikam-Fiber-TFVC",
"description": "Team Foundation Version Control projects.",
"url": "https://dev.azure.com/fabrikam/_apis/projects/eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
"state": "wellFormed"
},
{
"id": "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c",
"name": "Fabrikam-Fiber-Git",
"description": "Git projects",
"url": "https://dev.azure.com/fabrikam/_apis/projects/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c",
"state": "wellFormed"
},
{
"id": "281f9a5b-af0d-49b4-a1df-fe6f5e5f84d0",
"name": "TestGit",
"url": "https://dev.azure.com/fabrikam/_apis/projects/281f9a5b-af0d-49b4-a1df-fe6f5e5f84d0",
"state": "wellFormed"
}
]
}
您甚至不需要使用Postman或创建Http请求,只需在浏览器中输入上面的API网址即可。
答案 1 :(得分:0)