Skip to content

Latest commit

 

History

History
83 lines (70 loc) · 3.67 KB

policy-definitions.md

File metadata and controls

83 lines (70 loc) · 3.67 KB

Policy Definitions

On this page

Policy Definition Files

Poliy definition files are managed within the the folder policyDefintions under Definitions. The Policy definition files are structured based on the official Azure Policy definition structure published by Microsoft. There are numerous definition samples available on Microsoft's GitHub repository for azure-policy.

NOTE: When authoring policy/initiative definitions, check out the Maximum count of Azure Policy objects

The names of the definition JSON files don't matter, the Policy and Initiative definitions are registered based on the name attribute. It is recommended that you use a GUID as the name. The solution also allows the use of JSON with comments by using .jsonc instead of .json for the file extension.

Recommendations

Example

{
    "name": "Newly created GUID",
    "properties": {
        "displayName": "Policy Display Name",
        "policyType": "Custom",
        "mode": "All",
        "description": "Policy Description",
        "metadata": {
            "version": "1.0.0",
            "category": "Your Category"
        },
        "parameters": {
            "YourParameter": {
                "type": "String",
                "metadata": {
                    "displayName": "YourParameter",
                    "description": "Your Parameter Description"
                }
            }
        },
        "policyRule": {
            "if": {
                "Insert Logic Here"
            },
            "then": {
                "effect": "Audit, Deny, Modify, etc.",
                "details": {
                    "roleDefinitionIds": [],
                    "operations": []
                }
            }
        }
    }
}

Reading List

Return to the main page