Overview
Azure Policy allows you to define and enforce organizational standards and rules across your Azure environment. It helps ensure that your resources are configured in a consistent and compliant manner.
Key Concepts
- Policy Sets: Collections of policies that represent a specific environment or scope.
- Policy Definitions: The actual rules that determine the desired state of your resources.
- Assignments: Operations that apply policy definitions to a scope (subscription, resource group, or individual resource).
Policy Types
Azure Policy offers various policy types, including:
- Binary: Evaluates to true or false.
- Regulated: For compliance and regulatory reporting.
- Custom: For defining policies specific to your organization's requirements.
Example Policy Definitions
Below are examples of common policy definitions. (Detailed examples with JSON configuration can be found at the examples page)
{
"mode": "Indexed",
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"notEquals": "Microsoft.Compute/virtualMachines"
}
]
},
"then": {
"effect": "Audit"
}
}
}