你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

删除对委派的访问权限

在将客户的订阅或资源组委派给 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 市场时,还可以在“授权”中选择此角色。

具有此权限的用户可以通过以下的一种方法删除委托。

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>

后续步骤