Skip to main content
  1. Home
  2. >
  3. Azure
  4. >
  5. AZ-104
  6. >
  7. Azure Policy Deny vs Exclude Scope | Azure AZ-104

Azure Policy Deny vs Exclude Scope | Azure AZ-104

Jeff Taakey
Author
Jeff Taakey
21+ Year Enterprise Architect | Multi-Cloud Architect & Strategist.

While preparing for the Azure AZ-104 exam, many candidates struggle with effectively understanding Azure Policy scopes and exclusions in enterprise governance scenarios. In real-world hybrid and cloud migrations, enforcing organizational standards without hindering trusted projects requires fine-grained policy targeting and exemption design. Let’s drill into a simulated governance scenario.

The Scenario
#

Tailwind Electronics, a multinational enterprise, manages its Azure resources under a single subscription called TailwindSubscription01. To enforce IT governance, an Azure Policy is assigned at the subscription scope that denies deployment of the Microsoft.Sql/servers resource type, effectively blocking new Azure SQL servers across the subscription. However, the engineering team reserves the resource group TailwindSubscription01/EngineeringRG as an exception to allow certain SQL server deployments needed for critical projects.

Key Requirements
#

Determine what effect the Azure Policy with a “deny” effect on Microsoft.Sql/servers, scoped to the subscription but excluding EngineeringRG, will have on Azure SQL Server resource deployments.

The Options
#

  • A) Blocking creation of any Azure SQL servers anywhere in TailwindSubscription01
  • B) Allowing Azure SQL servers only in EngineeringRG
  • C) Blocking creation of Azure SQL servers only in the excluded resource group EngineeringRG
  • D) Allowing creation of Azure SQL servers in every resource group within TailwindSubscription01

Correct Answer
#

B) Allowing Azure SQL servers only in EngineeringRG


The Architect’s Analysis
#

Correct Answer
#

Option B

Step-by-Step Winning Logic
#

Azure Policy assignments with deny effects prevent resource creation of disallowed types within the assigned scope. However, when exclusions are defined (in this case, the EngineeringRG resource group), Azure Policy bypasses enforcement in those excluded scopes. This pattern is commonly used in large enterprises to centrally govern resources while allowing trusted teams the flexibility to deploy exceptions.

This approach supports core pillars of the Microsoft Well-Architected Framework:

  • Security: Central policy minimizes unauthorized resource sprawl.
  • Operational Excellence: Clear exceptions reduce friction for critical workloads.
  • Cost Management: Prevents unexpected or unsupported resource deployment.
  • Reliability: Limits resource types to managed and tested locations.

Moreover, this method aligns with CAF Governance best practices: centralized control with delegated exceptions.

The Traps (Distractor Analysis)
#

  • Why not A? The policy excludes EngineeringRG, so SQL servers can be created there. It’s not a block everywhere.
  • Why not C? The exclusion means the policy is not enforced in EngineeringRG, so blocking there is incorrect.
  • Why not D? The policy blocks creation outside the exclusion, so allowing everywhere is false.

The Architect Blueprint
#

Mermaid Diagram illustrating the policy enforcement scope and exclusion effect with Azure Policy.

graph TD subgraph Subscription [TailwindSubscription01] A1["EngineeringRG (Excluded)"] A2["Other RGs (Policy Enforced)"] end User1[User] --> |"Create SQL Server"| A1 User2[User] --> |"Create SQL Server"| A2 A1 --> |"Allowed"| SQL1["Azure SQL Server"] A2 --> |"Denied"| Deny["Creation Blocked by Policy"] style Subscription fill:#f9f9f9,stroke:#333,stroke-width:2px style SQL1 fill:#5C2D91,stroke:#333,color:#fff style Deny fill:#D32F2F,stroke:#333,color:#fff

Diagram Note: SQL server creation requests in the excluded resource group succeed, while requests elsewhere are blocked by the subscription-level deny policy.


The Decision Matrix
#

Option Est. Complexity Est. Monthly Cost Pros Cons
A Low N/A Simple to enforce across whole subscription Blocks all SQL servers, no exceptions
B Medium N/A Granular control with exclusions for exceptions Slight policy complexity with exclusions
C Low N/A Misunderstands exclusion behavior Blocks resources where exception is needed
D Low N/A Incorrect, policy is enforceable elsewhere Allows disallowed resources globally

Real-World Practitioner Insight
#

Exam Rule
#

“For AZ-104, understand that policy exclusions override assignment scope when managing resource governance.”

Real World
#

Enterprises often apply restrictive policies at high scopes but carve out exceptions for dev/test or special projects via exclusions. Azure Policy’s flexibility is indispensable for hybrid cloud governance, ensuring global compliance while enabling fast innovation under controlled boundaries.

Weekly Azure AZ-104 Drills

Master Azure administration from identity to networking.