【问题标题】:How to find disabled azure services in azure devops project如何在 azure devops 项目中找到禁用的 azure 服务
【发布时间】:2021-08-28 00:18:01
【问题描述】:

我们可以从 UI 中禁用 azure devops 服务

是否有任何 API 可用于获取有关启用/禁用服务的信息?

就像上面的图片板被禁用了,我可以使用 API 找到这个信息吗?

【问题讨论】:

    标签: azure-devops azure-devops-rest-api


    【解决方案1】:

    这是项目设置中的一项功能。 我检查了团队项目的相关REST APIAzure CLI,但是我没有发现任何可用的接口可以列出有关启用/禁用服务的信息,也没有可用的接口来启用/禁用服务。

    所以,我认为您的问题更像是一个功能请求。我建议您可以将功能请求报告给Developer Community

    [更新]

    我从网络浏览器的 Network 日志中找到了以下 API(按 F12)。我已经在我这边测试过这个 API,它应该是你要找的那个。

    • 请求 URI:
    POST https://dev.azure.com/{Organization_name}/_apis/FeatureManagement/FeatureStatesQuery/host/project/{Project_id}?api-version=4.1-preview.1
    
    • 请求正文:
    {
        "featureIds": [
            "ms.vss-work.agile",  // Boards
            "ms.vss-code.version-control",  // Repos
            "ms.vss-build.pipelines",  // Pipelines
            "ms.vss-test-web.test",  // Test Plans
            "ms.feed.feed"  // Artifacts
        ],
        "featureStates": {},
        "scopeValues": {
            "project": "{Project_id}"
        }
    }
    
    • 响应正文:
    {
        "featureIds": [
            "ms.vss-work.agile",
            "ms.vss-code.version-control",
            "ms.vss-build.pipelines",
            "ms.vss-test-web.test",
            "ms.feed.feed"
        ],
        "featureStates": {
            "ms.vss-work.agile": {
                "featureId": "ms.vss-work.agile",
                "scope": {
                    "userScoped": false,
                    "settingScope": "project"
                },
                "state": "disabled"
            },
            "ms.vss-code.version-control": {
                "featureId": "ms.vss-code.version-control",
                "scope": null,
                "state": "enabled"
            },
            "ms.vss-build.pipelines": {
                "featureId": "ms.vss-build.pipelines",
                "scope": null,
                "state": "enabled"
            },
            "ms.vss-test-web.test": {
                "featureId": "ms.vss-test-web.test",
                "scope": null,
                "state": "disabled",
                "reason": "\"Test Plans\" is off because the \"Boards\" feature is off. In order to manage \"Test Plans\", you must turn on \"Boards\".",
                "overridden": true
            },
            "ms.feed.feed": {
                "featureId": "ms.feed.feed",
                "scope": null,
                "state": "enabled"
            }
        },
        "scopeValues": {
            "project": "{Project_id}"
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-06-14
      • 2021-04-19
      • 2021-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多