繁体   English   中英

Azure Devops - 如何在编辑服务连接中重置资源组

[英]Azure Devops - How to reset Resource Group in Edit service connection

在更新服务连接的密钥时,我不小心也将Resource group设置为特定组,而之前它是空白的,因此它可以访问整个订阅。

我想将其还原,以便它可以访问整个订阅,但我似乎无法清除Resource group ,似乎一旦设置就无法清除。

除了删除此服务连接并创建一个具有相同名称的新服务连接外,还有其他方法可以将Resource Group设置为空白/空白吗? 我找不到任何az clips命令。 我知道我可以手动授予对服务主体的访问权限,但是从 UI 的角度来看它可能会产生误导,因为它只显示一个resource group

在此处输入图像描述

我们无法在 UI 中将资源组更改为空,因为它是设计使然。

有一个解决方法是使用Rest API修改服务连接。 请参阅类似案例: https://developercommunity.visualstudio.com/t/Cant-change-resource-group-to-empty-in-/1396077

获取请求正文:

GET https://dev.azure.com/{organization}/{project}/_apis/serviceendpoint/endpoints/{endpointId}?api-version=7.1-preview.4

更新服务连接:

PUT https://dev.azure.com/{organization}/_apis/serviceendpoint/endpoints/{endpointId}?api-version=7.1-preview.4

请将 scope 设置为空。

"authorization": {
    "parameters": {
        "tenantid": "",
        "serviceprincipalid": "",
        "authenticationType": "spnKey",
        "scope": "",  // this is the resource group
        "serviceprincipalkey": null
    },
    "scheme": "ServicePrincipal"
},

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM