移除委派的存取權

將客戶的訂用帳戶或資源群組委派給 Azure Lighthouse 的服務提供者之後,您可以視需要移除委派。 移除委派之後,先前授與服務提供者租用戶中使用者的 Azure 委派資源管理存取權將不再適用。

只要客戶租用戶或服務提供者租用戶中的使用者具有適當的權限,他們就可以移除委派。

提示

雖然我們在這個主題中所述的是服務提供者和客戶,但管理多個租用戶的企業可以使用相同的程序。

重要

當客戶訂用帳戶有多個來自相同服務提供者的委派時,移除一個委派可能會導致使用者失去透過其他委派授與的存取權。 只有在多個委派中包含相同的 principalIdroleDefinitionId 組合,然後移除其中一個委派時,才會發生這種情況。 若要修正此問題,請針對您未移除的委派重複 上執行緒序

客戶

客戶租用戶中,如果使用者的角色具有 Microsoft.Authorization/roleAssignments/write 權限 (例如擁有者),該使用者就能移除該訂用帳戶 (或該訂用帳戶中資源群組) 的服務提供者存取權。 若要這樣做,使用者可以移至 Azure 入口網站的[服務提供者] 頁面,在 [服務提供者供應項目] 畫面上尋找供應項目,然後選取該供應項目資料列中的垃圾桶圖示。

確認刪除之後,服務提供者租用戶中的任何使用者都無法存取先前已委派的資源。

服務提供者

如果管理租用戶中的使用者取得客戶資源的受控服務註冊指派刪除角色,則他們可以移除委派資源的存取權。 如果未將此角色指派給任何服務提供者使用者,則委派只能由客戶租使用者中的使用者移除。

此範例示範指派,授與 受控服務註冊指派刪除角色 ,可在 上執行緒序期間包含在參數檔案中:

    "authorizations": [ 
        { 
            "principalId": "cfa7496e-a619-4a14-a740-85c5ad2063bb", 
            "principalIdDisplayName": "MSP Operators", 
            "roleDefinitionId": "91c1777a-f3dc-4fae-b103-61d183457e46" 
        } 
    ] 

建立受控服務供應項目以發佈至 Azure Marketplace 時,也可以在授權中選取此角色。

擁有此權限的使用者可以使用下列其中一種方式移除委派。

Azure 入口網站

  1. 瀏覽至 [我的客戶] 頁面
  2. 選取 [委派]。
  3. 尋找您想要移除的委派,然後選取出現在其資料列中的垃圾桶圖示。

PowerShell

# Log in first with Connect-AzAccount if you're not using Cloud Shell

# Sign in as a user from the managing tenant directory 

Login-AzAccount

# Select the subscription that is delegated - or contains the delegated resource group(s)

Select-AzSubscription -SubscriptionName "<subscriptionName>"

# Get the registration assignment

Get-AzManagedServicesAssignment -Scope "/subscriptions/{delegatedSubscriptionId}"

# Delete the registration assignment

Remove-AzManagedServicesAssignment -Name "<Assignmentname>" -Scope "/subscriptions/{delegatedSubscriptionId}"

Azure CLI

# Log in first with az login if you're not using Cloud Shell

# Sign in as a user from the managing tenant directory

az login

# Select the subscription that is delegated – or contains the delegated resource group(s)

az account set -s <subscriptionId/name>

# List registration assignments

az managedservices assignment list

# Delete the registration assignment

az managedservices assignment delete --assignment <id or full resourceId>

後續步驟