Resource policy definitions - az policy definition

Manage resource policy definitions.

Commands

az policy definition create Create a policy definition.
az policy definition delete Delete a policy definition.
az policy definition list List policy definitions.
az policy definition show Gets the policy definition.
az policy definition update Update a policy definition.

az policy definition create

Create a policy definition.

az policy definition create --name
--rules
[--description]
[--display-name]

Examples

Create a policy with following rules

{
                            "if":
                            {
                                "source": "action",
                                "equals": "Microsoft.Storage/storageAccounts/write"
                            },
                            "then":
                            {
                                "effect": "deny"
                            }
                        }

Required Parameters

--name -n

Name of the new policy definition.

--rules

JSON formatted string or a path to a file with such content.

Optional Parameters

--description

Description of policy definition.

--display-name

Display name of policy definition.

az policy definition delete

Delete a policy definition.

az policy definition delete --name

Required Parameters

--name -n

The policy definition name.

az policy definition list

List policy definitions.

az policy definition list [--filter]

Optional Parameters

--filter

The filter to apply on the operation.

az policy definition show

Gets the policy definition.

az policy definition show --name

Required Parameters

--name -n

The policy definition name.

az policy definition update

Update a policy definition.

az policy definition update --name
[--description]
[--display-name]
[--rules]

Required Parameters

--name -n

The policy definition name.

Optional Parameters

--description

Description of policy definition.

--display-name

Display name of policy definition.

--rules

JSON formatted string or a path to a file with such content.