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

PolicyAssignment.DefinitionStages.WithScope Interface

public static interface PolicyAssignment.DefinitionStages.WithScope

A policy assignment specifying the scope of the policy.

Method Summary

Modifier and Type Method and Description
abstract WithPolicyDefinition forResource(GenericResource genericResource)

Specifies the scope of the policy assignment to be a resource.

abstract WithPolicyDefinition forResourceGroup(ResourceGroup resourceGroup)

Specifies the scope of the policy assignment to be a resource group.

abstract WithPolicyDefinition forScope(String scope)

Specifies the scope of the policy assignment.

Method Details

forResource

public abstract PolicyAssignment.DefinitionStages.WithPolicyDefinition forResource(GenericResource genericResource)

Specifies the scope of the policy assignment to be a resource.

Parameters:

genericResource - the resource to assign the policy

Returns:

the next stage of policy assignment

forResourceGroup

public abstract PolicyAssignment.DefinitionStages.WithPolicyDefinition forResourceGroup(ResourceGroup resourceGroup)

Specifies the scope of the policy assignment to be a resource group.

Parameters:

resourceGroup - the resource group to assign the policy

Returns:

the next stage of policy assignment

forScope

public abstract PolicyAssignment.DefinitionStages.WithPolicyDefinition forScope(String scope)

Specifies the scope of the policy assignment.

Parameters:

scope - the scope of the policy assignment

Returns:

the next stage of policy assignment

Applies to