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

RoleAssignment.DefinitionStages.WithScope 接口

public static interface RoleAssignment.DefinitionStages.WithScope

允许指定分配范围的角色分配定义的阶段。

方法摘要

修饰符和类型 方法和描述
abstract WithCreate withResourceGroupScope(ResourceGroup resourceGroup)

将角色分配的范围指定为资源组。

abstract WithCreate withResourceScope(Resource resource)

将角色分配的范围指定为特定资源。

abstract WithCreate withScope(String scope)

指定角色分配的范围。

abstract WithCreate withSubscriptionScope(String subscriptionId)

将角色分配的范围指定为整个订阅。

方法详细信息

withResourceGroupScope

public abstract RoleAssignment.DefinitionStages.WithCreate withResourceGroupScope(ResourceGroup resourceGroup)

将角色分配的范围指定为资源组。

Parameters:

resourceGroup - 分配被分配者要访问的资源组

Returns:

角色分配定义的下一阶段

withResourceScope

public abstract RoleAssignment.DefinitionStages.WithCreate withResourceScope(Resource resource)

将角色分配的范围指定为特定资源。

Parameters:

resource - 被分配者要访问的资源

Returns:

角色分配定义的下一阶段

withScope

public abstract RoleAssignment.DefinitionStages.WithCreate withScope(String scope)

指定角色分配的范围。 范围通常是订阅、资源组、资源等的 ID。

Parameters:

scope - 分配的范围

Returns:

角色分配定义的下一阶段

withSubscriptionScope

public abstract RoleAssignment.DefinitionStages.WithCreate withSubscriptionScope(String subscriptionId)

将角色分配的范围指定为整个订阅。

Parameters:

subscriptionId - 分配被分配者的访问权限的订阅

Returns:

角色分配定义的下一阶段

适用于