簡體   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