Share via


az policy assignment non-compliance-message

Manage a policy assignment's non-compliance messages.

Commands

Name Description Type Status
az policy assignment non-compliance-message create

Add a non-compliance message to a policy assignment.

Core GA
az policy assignment non-compliance-message delete

Remove one or more non-compliance messages from a policy assignment.

Core GA
az policy assignment non-compliance-message list

List the non-compliance messages for a policy assignment.

Core GA

az policy assignment non-compliance-message create

Add a non-compliance message to a policy assignment.

az policy assignment non-compliance-message create --message
                                                   --name
                                                   [--policy-definition-reference-id]
                                                   [--resource-group]
                                                   [--scope]

Examples

Add a non-compliance message to a policy assignment.

az policy assignment non-compliance-message create -g MyResourceGroup -n MyPolicyAssignment -m 'Resources must follow naming standards'

Add a non-compliance message for a specific policy in an assigned policy set definition.

az policy assignment non-compliance-message create -g MyResourceGroup -n MyPolicySetAssignment -m 'Resources must use allowed SKUs' --policy-definition-reference-id SkuPolicyRefId

Required Parameters

--message -m

Message that will be shown when a resource is denied by policy or evaluation details are inspected.

--name -n

Name of the policy assignment.

Optional Parameters

--policy-definition-reference-id -r

Policy definition reference ID within the assigned initiative (policy set) that the message applies to.

--resource-group -g

The resource group where the policy will be applied.

--scope

Scope at which this policy assignment subcommand applies. Defaults to current context subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az policy assignment non-compliance-message delete

Remove one or more non-compliance messages from a policy assignment.

az policy assignment non-compliance-message delete --message
                                                   --name
                                                   [--policy-definition-reference-id]
                                                   [--resource-group]
                                                   [--scope]

Examples

Remove non-compliance messages from a policy assignment that contain a specific message and no policy definition reference ID.

az policy assignment non-compliance-message delete -g MyResourceGroup -n MyPolicyAssignment -m 'Resources must follow naming standards'

Remove non-compliance messages from a policy assignment that contain a specific message and a specific policy definition reference ID.

az policy assignment non-compliance-message delete -g MyResourceGroup -n MyPolicySetAssignment -m 'Resources must use allowed SKUs' --policy-definition-reference-id SkuPolicyRefId

Required Parameters

--message -m

Message that will be shown when a resource is denied by policy or evaluation details are inspected.

--name -n

Name of the policy assignment.

Optional Parameters

--policy-definition-reference-id -r

Policy definition reference ID within the assigned initiative (policy set) that the message applies to.

--resource-group -g

The resource group where the policy will be applied.

--scope

Scope at which this policy assignment subcommand applies. Defaults to current context subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az policy assignment non-compliance-message list

List the non-compliance messages for a policy assignment.

az policy assignment non-compliance-message list --name
                                                 [--resource-group]
                                                 [--scope]

Examples

List the non-compliance messages for a policy assignment.

az policy assignment non-compliance-message list -g MyResourceGroup -n MyPolicyAssignment

Required Parameters

--name -n

Name of the policy assignment.

Optional Parameters

--resource-group -g

The resource group where the policy will be applied.

--scope

Scope at which this policy assignment subcommand applies. Defaults to current context subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.