DFdom@fradley
← ~/writing
$ cat azure-policy-out-of-the-box.md

Azure Policy out of the box: 5,000 guardrails you already own

Sooner or later someone senior asks where you stand against ISO 27001, or whichever framework your sector answers to. In most organisations that starts a project: a spreadsheet of controls, screenshots chased from every team, and a report that is out of date by the meeting.

That's odd, because Azure ships with a compliance engine. Microsoft maintains a catalogue of just over 5,000 (as of August 2026) ready-written policy definitions and roughly 270 grouped rule-sets, including whole sets mapped control by control to those frameworks. Microsoft charges nothing for Azure Policy on Azure resources. None of it does anything until it's assigned. Open Policy in your own subscription and compare the assignment count to the catalogue size.

What's in the box

A definition is one rule: what to look for in a resource, and what to do when it matches. An initiative is a named bundle of definitions assigned as a unit, with a compliance score of its own.

The catalogue covers nearly every Azure service and is kept current as they change. It has a rule for storage accounts that allow public access, one for VMs with no backup, one for SQL servers without auditing, one for subnets with no network security group. When someone says "we should have a policy for that", the odds are Microsoft has already written it. I've written before about authoring a custom definition for a rule of your own.

If you use Microsoft Defender for Cloud, you're running a built-in initiative now: Defender assigns the Microsoft cloud security benchmark by default, and it's where the portal's security recommendations come from.

One assignment covers the whole estate

A definition sitting in the catalogue does nothing until you assign it to a scope. Assign an initiative at a management group and every subscription underneath inherits it, with every resource group and resource inside those. A subscription created next year lands under the same assignment the day it exists.

Management group One policy assignment Subscription Subscription Subscription inherited Resource group inherited Every resource inside
Assign once at the management group and everything beneath it is covered, including subscriptions that don't exist yet. Nobody has to remember to opt a new project in.

Effects: from audit to remediation

Every rule carries an effect, and teams are understandably wary of switching on a thousand rules and blocking every deployment. The effects let you roll them out gradually.

Audit flags non-compliant resources on a report and blocks nothing, so it costs nothing to switch on. Deny stops non-compliant resources at the door; a rule moves to deny once its audit results show no non-compliant resources. Remediation effects such as deployIfNotExists and modify fix what they find, which is best kept for boring, safe corrections like enabling a diagnostic setting. Other effects exist, but these three carry the operating model.

day one when the report goes quiet for the boring fixes audit report, block nothing deny block at create time remediate fix what it finds trust moves this way, one rule at a time
The rollout that never blocks anyone: everything starts in audit, individual rules earn their way to deny, and only the safest fixes are automated. The dial turns per rule, so a cautious estate and a strict one run the same catalogue.

Pick your framework

The Regulatory Compliance section holds initiatives whose groups mirror the control numbering of the framework itself, so the compliance page reads like the audit checklist. A sample, with the number of policies each carries:

Sector Frameworks (policies in each, August 2026)
Any CIS Azure Foundations v3.0.0 (53), ISO/IEC 27001 2022 (58), SOC 2 Type 2 (307)
UK UK OFFICIAL and UK NHS (45), Cyber Essentials v3.1 (106), NCSC Cyber Assurance Framework v3.2 (73)
Finance PCI DSS v4 (269), DORA (136), SWIFT CSCF 2024 (193), SOX 2022 (90)
Health HITRUST/HIPAA (589)
EU-wide GDPR (281), NIS2 (236), and a young EU AI Act set (6)
US federal NIST SP 800-53 Rev. 5 (696), FedRAMP High (711)

One caveat: assigning the NIST initiative does not make you NIST-compliant. These sets cover the technically checkable slice of each framework, and an auditor will still want your processes and paperwork. What you gain is evidence: per-resource compliance on a page you open, re-checked continuously.

Switch one on this week

Ask your platform team to assign one framework in audit mode. Within around half an hour the results start arriving in Portal → Policy → Compliance. Expect the first number to be ugly. It gives you a measured baseline to improve from.

Custom definitions still have a place: your tag schema, your naming standard, the SKUs your organisation has agreed to pay for. Nobody else will write those. For anything else, search the catalogue before writing a definition.

For your platform team: assigning a built-in initiative in audit mode

One command assigns CIS in audit mode, with the lookup done by display name so there are no magic GUIDs:

az policy assignment create \
  --name cis-v3-audit \
  --display-name "CIS Azure Foundations v3.0.0 (audit)" \
  --policy-set-definition "$(az policy set-definition list \
      --query "[?displayName=='CIS Azure Foundations v3.0.0'].name | [0]" -o tsv)"

Or as Terraform, which is how it should live long-term:

data "azurerm_subscription" "current" {}

data "azurerm_policy_set_definition" "cis" {
  display_name = "CIS Azure Foundations v3.0.0"
}

resource "azurerm_subscription_policy_assignment" "cis_audit" {
  name                 = "cis-v3-audit"
  display_name         = "CIS Azure Foundations v3.0.0 (audit)"
  subscription_id      = data.azurerm_subscription.current.id
  policy_definition_id = data.azurerm_policy_set_definition.cis.id
}

Initiatives that include remediation effects also want an identity block so the assignment can act on resources; an audit-only rollout doesn't need one. To read the results at the command line:

az policy state summarize \
  --query "policyAssignments[].{assignment:policyAssignmentId, nonCompliant:results.nonCompliantResources}" \
  -o table

The assignment above, plus the queries to read the results, are in the blog-examples repo.

More useful tidbits coming, one a week.

discuss on linkedin → more writing