我从TFS 2015
迁移到Azure DevOps
。创建目标项目和导入旧git存储库的过程可以通过Azure DevOps API
轻松完成。
但是每个新项目,无论是手动创建还是由API创建,都始终启用所有服务(Boards
,Pipelines
,Test Lab
,...)。有没有办法更改应在新项目上启用哪些服务的默认设置?或者甚至更好的API方法来打开/关闭某些服务?
我们有数百个项目,因此在浏览器中打开每个项目,切换到项目设置页面并调整服务是不可行的。
我没有在文档中找到任何东西:https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.0
This guy wrote a blog post on how to do this
这是从他的帖子中摘录的摘录:
PATCH https://{account}.visualstudio.com/_apis/FeatureManagement/FeatureStates/host/project/{project-id}/{feature-id}?api-version='4.1-preview.1'
content-type: application/json
{"featureId":"{feature-id}","scope":{"settingScope":"project","userScoped":false},"state":0}
根据需要替换account,project-id和feature-id。以下是我所知道的功能ID。
ms.vss-build.pipelines
ms.vss-test-web.test
ms.vss-work.agile
ms.vss-code.version-control
它看起来像turning a service off really just means hiding it from the UI。
编辑:it looks like the .net SDK has built in support for this as well