MICROSOFT AZ-104 GOVERNANCE GUIDE

Azure Policy vs RBAC vs Resource Locks.

Separate authorization, compliance and protection from accidental control-plane change.

Updated 18 August 2026 · Original ITCertPath learning resource

Who may act, what state is allowed, and what must not change

Azure RBAC

Assign a role to a user, group, service principal or managed identity at a defined resource scope.

Azure Policy

Evaluate resource state and actions against business rules, then audit, deny, modify or remediate.

Resource Lock

Prevent control-plane deletion or modification across authorized users and inherited child scope.

AZ-104 decision rule

Who can restart this VM? RBAC. Which regions or SKUs are compliant? Policy. Prevent accidental deletion regardless of role: CanNotDelete lock.

These controls are complementary. A Contributor may be authorized to create a resource through RBAC, yet Azure Policy can deny the deployment because its state is noncompliant. The same Contributor may be authorized to delete a resource, yet an inherited lock can block that control-plane deletion.

Compare the controls by requirement

RequirementControlImportant qualifier
Grant a team VM start and restart permissionsAzure RBACChoose a suitable role and the smallest practical scope
Allow deployment only in approved regionsAzure PolicyAssign a definition or initiative with an appropriate effect
Report resources missing a required tagAzure PolicyAudit reports state; modify/remediation can address supported configuration
Prevent deletion of a production resource groupCanNotDelete lockModification remains allowed; child resources inherit the lock
Prevent control-plane update and deletionReadOnly lockSome apparently read-like operations require POST and can also fail
Protect database rows or storage blobsData-plane authorization and protectionA management lock alone does not protect resource data

Azure RBAC: authorize a principal at scope

An Azure role assignment combines three elements: a security principal, a role definition and a scope. The role definition supplies allowed operations; the assignment applies those permissions at a management group, subscription, resource group or resource scope, with inheritance to children.

  • Principal: user, group, service principal or managed identity.
  • Role: built-in or custom collection of allowed management and/or data actions.
  • Scope: where the assignment applies.
  • Least privilege: grant only the operations and scope needed for the task.
  • Effective access: consider inherited assignments, groups, conditions and applicable deny assignments.

RBAC answers an identity-aware question. If a rule must apply to resource state no matter which authorized person or workload submits the request, Policy is usually the better governance mechanism.

Azure Policy: evaluate and govern resource state

A policy definition contains conditions and an effect. An assignment applies a definition—or an initiative containing several definitions—to a scope. Azure Policy evaluates applicable resources while honoring configured exclusions and exemptions.

Effect patternPurposeOperational clue
Audit / AuditIfNotExistsReport noncompliant stateVisibility without blocking the request
Deny / DenyActionBlock disallowed state or supported actionAuthorized user still receives a policy denial
ModifyAdd, update or remove supported properties or tagsExisting resources may need a remediation task
DeployIfNotExistsDeploy related configuration when conditions are metAssignment identity needs required deployment permissions

Existing noncompliant resources are not universally fixed merely because a policy is assigned. The effect, evaluation trigger and remediation configuration determine what happens. Test impact before assigning restrictive rules broadly.

Resource locks: broad control-plane protection

Management locks can be applied at subscription, resource-group or resource scope. Child resources inherit locks from parents. Azure exposes two levels:

  • CanNotDelete (Delete): authorized principals can read and modify the resource but cannot delete it through the protected control-plane path.
  • ReadOnly: authorized principals can read but cannot update or delete the resource through the control plane.

Control plane only: locks protect Azure Resource Manager operations. They do not automatically block data-plane operations against the service endpoint. A storage-account lock does not by itself prevent an authorized data-plane principal from deleting blobs.

Locks can also block operations that seem harmless because some services use POST for actions such as listing keys or regenerating credentials. Check service-specific behavior before placing ReadOnly locks on production resources.

Worked scenario: govern a production storage account

An organization needs operators to manage a production storage account, requires approved location and diagnostics, and wants to prevent accidental deletion.

  1. Assign operators a least-privilege Azure RBAC role at the storage-account or resource-group scope.
  2. Assign Azure Policy rules for allowed locations, required tags and diagnostic configuration.
  3. Use audit first to assess impact, then select deny, modify or deployIfNotExists effects according to the requirement.
  4. Create any required remediation task and ensure its managed identity has the necessary role.
  5. Apply a CanNotDelete lock at the resource or resource-group scope.
  6. Configure storage data-plane roles, soft delete, versioning and backup/recovery separately; the resource lock does not protect blob contents.
  7. Document who can modify policy assignments and remove locks, and monitor those governance changes.

This design gives operators legitimate access, enforces compliant configuration and adds an accidental-deletion barrier without confusing management-plane protection with data protection.

How the controls combine on one request

Do not memorize an oversimplified universal evaluation order. Instead, test each required gate:

  1. Identity and RBAC: is the principal authenticated and authorized for the requested operation at the effective scope?
  2. Resource lock: does a lock at the resource or an inherited parent scope prohibit the control-plane operation?
  3. Azure Policy: would the resulting resource state or supported action violate any applicable assignment?
  4. Service/data-plane controls: if the request targets resource data, what service-specific authorization, network and protection rules apply?

A successful operation must satisfy every applicable control. Granting Owner does not make a noncompliant Policy result compliant, and adding a management lock does not grant or revoke data-plane access.

Troubleshoot the correct governance layer

  1. Read the error and operation: identify the resource provider action and whether it targets control or data plane.
  2. Check effective RBAC: review direct and inherited role assignments at the failing scope.
  3. Check locks: inspect the resource and parent resource group/subscription for inherited CanNotDelete or ReadOnly locks.
  4. Check Policy details: identify the assignment, definition, effect, parameters, scope and exemption that produced denial or noncompliance.
  5. For remediation: verify the assignment identity, role assignment, supported effect and remediation-task status.
  6. Retest narrowly: correct the intended control rather than granting broad access or removing governance globally.

Fast symptom map

AuthorizationFailed: start with RBAC. RequestDisallowedByPolicy: inspect the Policy assignment. ScopeLocked: find direct or inherited locks. Blob/database data failure: inspect data-plane authorization and service controls.

AZ-104 practice checks with explanations

A Contributor can deploy VMs, but a VM in an unapproved region is denied. Why?

Best answer: RBAC authorized the action, but Azure Policy rejected the noncompliant resource state.

A production resource must allow updates but block deletion. Which lock?

Best answer: CanNotDelete. ReadOnly would also block control-plane updates and is more restrictive than required.

A storage account has a CanNotDelete lock, but an authorized user deletes a blob. Why?

Best answer: the management lock protects control-plane operations, not the storage data plane. Use storage data roles and data-protection features.

Existing resources show noncompliant after a Modify policy assignment. What may be required?

Best answer: create a remediation task and verify the policy assignment's managed identity has the permissions needed to change those resources.

Common AZ-104 mistakes

  • Using RBAC to enforce a configuration rule that must apply regardless of user.
  • Assuming Policy grants permissions to a principal.
  • Assuming a Contributor can bypass a deny Policy effect.
  • Choosing ReadOnly when only deletion protection is required.
  • Checking only the resource and missing an inherited parent lock.
  • Believing a resource lock protects database rows, blobs or other data-plane content.
  • Assuming all existing noncompliant resources remediate automatically.
  • Removing broad governance instead of diagnosing the assignment, lock or role at the correct scope.

Frequently asked questions

What is the difference between Azure Policy and Azure RBAC?

Azure RBAC authorizes actions for a security principal at a scope: who can do what and where. Azure Policy evaluates resource properties and actions against organizational rules, regardless of which authorized principal submitted the change.

What is the difference between Azure Policy and a resource lock?

Policy can audit, deny, modify or deploy configuration according to a reusable rule and assignment scope. A resource lock applies a broad CanNotDelete or ReadOnly control-plane restriction to a subscription, resource group or resource and is inherited by child resources.

Does an Azure resource lock protect data inside a resource?

Not generally. Resource locks apply to Azure control-plane operations. They do not automatically prevent data-plane changes such as deleting rows in a database or blobs through a storage data endpoint.

Can an Owner delete a locked Azure resource?

The lock blocks the protected control-plane operation even when RBAC otherwise authorizes it. A principal with permission to delete the lock can remove it first and then delete the resource, so locks reduce accidental change but are not a substitute for least privilege, backup or recovery controls.

Official Microsoft references

Confirm current service behavior and scope before changing production governance. ITCertPath uses original learning scenarios and does not reproduce confidential exam questions.