- Enforce organizational standards consistently across subscriptions and resource groups.
- Prevent accidental or non-compliant deployments (for example, disallowed regions or VM SKUs).
- Report compliance posture at scale and automate remediation where supported.
Core concepts
Common policy use cases:
- Required tags — ensure billing and organizational metadata are present.
- Inherit tags — populate tags from subscription or resource group.
- Allowed locations — limit where resources can be deployed (useful for data residency).
- Allowed VM SKUs — restrict VM sizes for cost control.
- Allowed resource types — prevent deployment of unwanted services.

Portal walkthrough and initiatives
In the Azure portal, search for “Policy” to manage Definitions, Initiatives, Assignments, and Compliance.- Definitions: Browse built-in and custom policy definitions.
- Initiative: A collection (group) of policies. Use initiatives to assign many related policies at once (for example, regulatory standards) and to get aggregated compliance reporting.



Example: Allowed locations policy
The built-in “Allowed locations” policy restricts where resources may be deployed. It accepts a parameterlistOfAllowedLocations (an array of regions) and denies deployments that are neither in that list nor marked as global.
Consolidated example policy definition (parameters and rule):
Assigning the policy
Click Assign to apply the policy to a scope. Choose from management group, subscription, resource group, or a specific resource; specify any exclusions and parameter values; give the assignment a name and description; and set enforcement to Enabled to actively block disallowed deployments.
Be careful when enabling enforcement. If you set the assignment to
Enabled (or use the deny effect), new deployments outside the allowed set will fail. To evaluate impact without blocking, use Audit or set enforcement to Disabled temporarily.listOfAllowedLocations to eastus and westus) and optionally add a custom non-compliance message to help users understand the requirement.

Policy evaluation can be delayed by a few minutes after assignment. If a deployment is attempted immediately after assignment, it may still be allowed until the evaluation is active.
Monitor compliance
After assignment, go to Policy > Compliance to review aggregated and assignment-level compliance. The initial status may showNotStarted until the service completes evaluations (typically 5–15 minutes).

Testing assignments — expected behaviors
- Creating a resource in an allowed region succeeds.
- Attempting to create a resource in a disallowed region will fail once enforcement is active.
- If a deployment is started while evaluation is still propagating, it may initially proceed but will fail when policy enforcement runs.




Summary
- Policy definition = JSON document that defines the rule and effect.
- Scope = management group, subscription, resource group, or resource.
- Assignment = applying a definition to a scope; includes parameters and exclusions.
- Compliance = evaluation of resources after assignment; pre-existing non-compliant resources remain until remediated.
- Initiative = a grouped collection of policies assigned together for simplified management and aggregated compliance reporting.
- Policy effects (
Audit,Append,DeployIfNotExists,Modify,Deny) and their behaviors. - Creating custom policies and initiatives.
- Remediation tasks and
DeployIfNotExistspatterns. - Using Azure Policy with IaC (ARM templates, Bicep, Terraform) and Azure Blueprints.