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

RoleAssignment.DefinitionStages.WithScope 接口

public interface WithScope

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

方法摘要

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

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

RoleAssignment.DefinitionStages.WithCreate withResourceScope(Resource resource)

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

RoleAssignment.DefinitionStages.WithCreate withScope(String scope)

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

RoleAssignment.DefinitionStages.WithCreate withSubscriptionScope(String subscriptionId)

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

方法详细信息

withResourceGroupScope

public WithCreate withResourceGroupScope(ResourceGroup resourceGroup)

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

Parameters:

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

Returns:

角色分配定义的下一阶段

withResourceScope

public WithCreate withResourceScope(Resource resource)

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

Parameters:

resource - 被分配者有权访问的资源

Returns:

角色分配定义的下一阶段

withScope

public WithCreate withScope(String scope)

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

Parameters:

scope - 分配的范围

Returns:

角色分配定义的下一阶段

withSubscriptionScope

public WithCreate withSubscriptionScope(String subscriptionId)

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

Parameters:

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

Returns:

角色分配定义的下一阶段

适用于