![](/img/trans.png)
[英]Failed to send query to service connection API when using Azure devops api serviceendpoint to create kubernetes service connection
[英]Error when trying to create service connection in azure devops
我的需求是使用Azure Devops服務創建服務連接,所以我在azure入口創建了一個azure AD應用
在 azure Devops 項目設置中,我創建了一個新的服務連接,但是當我單擊驗證時,它會拋出錯誤:
查詢服務連接失敗 API "https://managemant.azure.com/sub/xxx?api-version=2016-06-01.status code:'status code:{"error",:{code""Authorization failed message" 'the client" with object id "does not have authorization to perform action 'microsoft.resource/sub/read,over scope'/sub/*** or scope is invalid.
如果訪問最近被授予。請刷新您的憑據}}
將不勝感激這方面的任何幫助
TIA
根據錯誤消息,您可以嘗試使用 go 訪問門戶並找到您的訂閱,單擊訪問控制 (IAM),然后單擊添加角色分配使用 object id。 然后嘗試創建一個新的服務連接來檢查它是否有效。
我試圖在我的環境中重現相同的內容並得到如下相同的錯誤:
要解決該錯誤,請將讀者角色/權限分配給訂閱級別的 Azure AD 應用程序,如下所示:
Go 至 Azure 門戶 -> 訂閱 -> Select 您的訂閱 -> 訪問控制 (IAM) -> 添加角色分配
分配角色后驗證成功如下:
您還可以根據您的要求分配貢獻者角色。
您當前使用的服務主體或托管身份來自 Azure Devops 沒有創建另一個服務主體的權限。 您必須分配特定權限才能在 Azure AD 租戶上創建服務主體。 您可以嘗試為您用於從 Az Devops 進行身份驗證的 ID 提供“應用程序開發人員”角色。
請參考此 MS 鏈接以供參考: Permsissions
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.