Designing Governance Controls: Azure Policy, Initiatives, Locks, Blueprints Replacement and Compliance Reporting
Policy, RBAC and Locks: Different Jobs
| Tool | Question it answers |
| RBAC | Who can do what? |
| Azure Policy | What settings are allowed or required? |
| Resource locks | Can this resource be deleted or changed by accident? |
Policy Effects
| Effect | Action |
| Audit | Mark as non-compliant, do not block |
| Deny | Block the request |
| Modify | Add or change properties such as tags |
| DeployIfNotExists | Deploy a related resource, such as diagnostic settings |
| AuditIfNotExists | Report when a related resource is missing |
| Disabled | Turn it off |
- Start with Audit, review results, then move to Deny to avoid breaking teams
- Modify and DeployIfNotExists need a managed identity and remediation tasks for existing resources
- Use exemptions with an expiry date, not policy deletion
Initiatives and Built-in Policies
- An initiative groups many policies (for example the Microsoft cloud security benchmark, ISO 27001, PCI DSS)
- Assign initiatives at management group level
- Typical required policies: allowed regions, allowed SKUs, require tags, require private endpoints, deny public IPs, enable diagnostic settings, require HTTPS and TLS 1.2
json
{
"if": { "allOf": [
{ "field": "type", "equals": "Microsoft.Storage/storageAccounts" },
{ "field": "Microsoft.Storage/storageAccounts/allowBlobPublicAccess", "notEquals": false } ] },
"then": { "effect": "deny" }
}
Locks
- CanNotDelete: can change, cannot delete
- ReadOnly: cannot change or delete (can break some operations)
- Locks apply to everyone including Owners. Use sparingly on critical items such as network and vaults
Standardized Deployments
Blueprints Azure Blueprints is being retired. Check the current status. Use template specs, Bicep modules, deployment stacks and Azure Policy with pipelines instead.
| Tool | Use |
| Template specs | Versioned, shareable ARM or Bicep templates stored in Azure |
| Deployment stacks | Manage resources as one unit with deny settings and cleanup |
| Bicep registry / modules | Reusable building blocks |
| Azure Verified Modules | Microsoft-supported module library |
Compliance and Reporting
- The Policy compliance page shows percent compliant by scope and policy
- Defender for Cloud regulatory compliance maps controls to standards
- Resource Graph queries inventory across subscriptions
- Export to Log Analytics and Power BI for audits
kql
resources
| where type =~ 'microsoft.storage/storageaccounts'
| where properties.allowBlobPublicAccess == true
| project name, resourceGroup, subscriptionId
Design Example
Company rules: data stays in India, no public IPs on VMs, every resource has an owner tag, diagnostics go to a central workspace. Design: management group policy for allowed regions (deny), no public IPs (deny), owner tag (deny if missing) and diagnostics (deployIfNotExists), with a remediation task for old resources.
Practice
- Choose an effect for each of five rules
- Write an exemption plan for a legacy app
- Query Resource Graph for VMs without an Owner tag
Conclusion
Use RBAC for who, Policy for what, locks for accidents. Roll out policy with audit first, group controls in initiatives, deploy standards with Bicep and template specs and report with compliance tools.
Quick Summary: three tools; effects; initiatives; locks; deployment standards; reporting; example.