Study guide

4.3 Resource Locks and Azure RBAC

Microsoft Certified: Cloud and AI Security Engineer Associate SC-500

Track your progress as you read

Finished sections get a check mark.

1 Introduction & Exam Overview

1.1 Current Exam Facts 1.2 Skills Measured & Weightings 1.3 Study Path, Prerequisites & Exam Strategy

2 Microsoft Entra ID Secure Access

2.1 Privileged Identity Management (PIM) 2.2 Conditional Access Policies 2.3 MFA and Passwordless Authentication 2.4 Application Identities, OAuth Consent & Managed Identities

3 Azure Key Vault Secrets and Keys

3.1 Deploy and Configure Key Vault 3.2 Access Control and Firewall for Key Vault 3.3 Keys, Secrets, Certificates & Defender for Key Vault

4 Governance, Policy & RBAC

4.1 Azure Policy for Security Controls 4.2 Defender for Cloud Compliance & Security Standards 4.3 Resource Locks and Azure RBAC 4.4 Custom Roles, Overprivileged Access, Backup & IaC Security

5 Secure Storage Accounts

5.1 Storage Account Security Fundamentals 5.2 Storage Firewalls and Access Policies 5.3 Defender for Storage

6 Secure Databases

6.1 Azure SQL Platform Security 6.2 Database Auditing 6.3 Defender for Databases

7 Network Security Groups & Virtual Network Manager

7.1 Network Security Groups and Application Security Groups 7.2 Azure Virtual Network Manager Security Admin Rules 7.3 Virtual WAN and VPN Security

8 Private Access, Private Link & Azure Firewall

8.1 Microsoft Entra Private Access 8.2 Private Endpoints and Private Link 8.3 Azure Firewall 8.4 Network Watcher Diagnostics and Effective Rules

9 Security for AI Workloads

9.1 Purview DSPM for AI and Data Overexposure 9.2 Copilot Studio Protection and Agent Management 9.3 Microsoft Entra Agent ID Security 9.4 Defender for AI, Foundry Guardrails & AI Gateway

10 Secure Servers and Virtual Machines

10.1 Disk Encryption 10.2 Azure Bastion and JIT VM Access 10.3 Azure Arc and Defender for Servers 10.4 Trusted Launch, VM Security Features & Machine Configuration

11 Application Platform Security

11.1 Containers: AKS, ACR, ACI, Container Apps & Defender for Containers 11.2 Azure Functions and Logic Apps Security 11.3 Azure App Service Security 11.4 Web Application Firewall and API Management Protection

12 Defender for Cloud Security Posture

12.1 Defender CSPM and Secure Score 12.2 Workload Protection Plans and Multicloud Connectors 12.3 Vulnerability Management and Defender EASM

13 Microsoft Sentinel Activity and Event Collection

13.1 Workspaces, Roles & Content Hub 13.2 Data Connectors, Syslog/CEF & Windows Event Collection 13.3 Custom Tables, Retention & Purview Audit 13.4 Automation Rules and Playbooks

14 Microsoft Security Copilot & Final Review

14.1 Microsoft Security Copilot Workspaces and Roles 14.2 Plugins and Security Agents 14.3 Final Review and Exam-Day Strategy

4.3 Resource Locks and Azure RBAC

Key Takeaways Explain This Topic AI

Resource locks are CanNotDelete (Delete) and ReadOnly; they apply to all principals and override RBAC allow permissions for the restricted operations.

Locks inherit from parent scopes; the most restrictive lock wins; locks apply to control-plane operations, not data-plane resource usage.

Creating or deleting locks requires Microsoft.Authorization/locks permissions—typically Owner or User Access Administrator (or a custom role with locks actions).

Core built-in roles: Owner (full + assign roles), Contributor (manage resources, no role assign), Reader (read-only), User Access Administrator (manage access), plus Security Admin/Reader and Key Vault–specific roles for data plane.

Deny assignments block actions even when roles allow them; customers do not freely create deny assignments—Azure creates them (for example via deployment stacks / managed experiences).

Last updated: July 2026

4.3 Resource Locks and Azure RBAC

Quick Answer: Apply CanNotDelete locks so resources can be updated but not deleted; apply ReadOnly locks so resources cannot be updated or deleted (similar to forcing Reader-like restrictions on the control plane). Locks inherit downward and require Owner or User Access Administrator (or equivalent locks permissions) to remove. Pair locks with Azure RBAC roles— Owner , Contributor , Reader , User Access Administrator , security roles, and Key Vault roles—assigned at the correct scope . Remember deny assignments can block actions even when a role allows them.

Resource locks

Management locks sit above normal RBAC allow rules for the operations they restrict. Even an Owner cannot delete a resource that has a CanNotDelete lock until the lock is removed (and removing the lock itself requires authorization permissions).

  • Portal name API / CLI name Allows Blocks
  • Delete CanNotDelete Read and update (control plane) Delete
  • Read-only ReadOnly Read Update and delete
  • Inheritance and precedence

Locks on a subscription or resource group apply to resources inside, including resources created later.

The most restrictive lock in the inheritance chain takes precedence.

You cannot add locks at management group scope in the portal model described by Microsoft docs—locks are subscription / resource group / resource scoped.

Attempting to delete a resource group fails entirely if any resource inside is locked against delete—Azure does not partially delete the group.

Control plane vs data plane (critical trap)

Locks protect Azure Resource Manager control-plane operations ( management.azure.com ). They do not turn a storage account into an immutable data vault by themselves:

A CanNotDelete lock on a storage account stops deleting the account resource, but blob data can still be deleted via data-plane APIs unless other data protections exist.

A ReadOnly lock on a storage account can block list keys (a POST control-plane operation) and some management actions, pushing callers toward Microsoft Entra data-plane auth—yet data-plane writes may still occur depending on the API path.

ReadOnly on a resource group can block VM start/restart (POST actions) and other management operations that look “operational” but are control-plane writes.

Scenario: Finance applies CanNotDelete on the production resource group containing a SQL server. An engineer with Contributor can still scale the database and patch firewall rules, but cannot delete the server or the resource group. Separately, application users continue to run INSERT/DELETE on table data—the lock never intended to freeze SQL row operations.

Who can create or delete locks?

Creating or deleting locks requires Microsoft.Authorization/locks/* (or broader Microsoft.Authorization/* ). Built-in roles that include this capability include:

  • Owner
  • User Access Administrator

Specialized custom roles can grant only lock actions if you want lock operators without full Owner. Contributor cannot manage locks —a classic exam discriminator.

Operational gotchas worth memorizing

Backup and restore point cleanup can break if a CanNotDelete lock blocks the resource group Azure Backup uses for restore points.

Managed applications (for example some Databricks patterns) create system-locked managed resource groups you should not fight—delete the service, not the lock, when decommissioning.

Locks do not block subscription cancellation workflows the way they block resource deletes.

Azure RBAC fundamentals

Azure role-based access control grants allow permissions to security principals (users, groups, service principals, managed identities) at a scope.

  • Scope hierarchy Management group
  • └── Subscription
  • └── Resource group
  • └── Resource

Permissions inherit downward. Assign at the highest scope that still meets least privilege . Prefer resource group or resource scope over subscription-wide Owner.

A role assignment has three parts: security principal + role definition + scope . Optional conditions (ABAC) can further constrain assignments (for example, allow blob access only when a certain tag matches).

Built-in roles you must know cold

  • Role Can manage resources? Can assign Azure roles? Typical use
  • Owner Yes (full) Yes Subscription/RG break-glass owners
  • Contributor Yes No Workload operators who must not grant access
  • Reader No (read only) No Auditors, viewers

User Access Administrator No resource “Contributor” powers Yes (manage access) Identity/access admins without resource change rights

Role Based Access Control Administrator Manage RBAC assignments (narrower privileged access admin pattern) Yes (RBAC focus) Delegate access management without full classic UAA semantics

Security Admin Security posture configuration in Microsoft Defender for Cloud / security center capabilities No (not a substitute for Owner) Security engineering teams

Security Reader Read security findings/posture No Security analysts (note Policy compliance visibility limits mentioned earlier)

Key Vault–related roles (control vs data plane)

Key Vault is a favorite exam surface because control-plane roles (who can change vault firewall, diagnostics, locks) differ from data-plane roles (who can get secrets/keys/certificates):

Role examples Plane Purpose

Key Vault Contributor (and general Contributor/Owner) Control plane Manage vault resource, not automatically all secret get rights under RBAC model

Key Vault Administrator / Secrets Officer / Crypto Officer / Secrets User / Reader, etc. Data plane (RBAC permission model) Fine-grained cryptographic and secret operations

Always confirm whether the vault uses the Azure RBAC permission model or legacy access policies —chapter 3 covered that choice; here the point is that “Contributor on the RG” is not the same as “can read production connection strings.”

Security Admin vs Security Reader

Security Reader: view recommendations, alerts, security posture.

Security Admin: also change security policies/configuration in Defender for Cloud–related settings without granting full resource Contributor on every workload.

Neither replaces Owner for deleting production VMs, and neither alone is the universal answer for “who can remove a resource lock.”

Deny assignments (overview)

Deny assignments attach a set of denied actions to principals at a scope. They block operations even if a role assignment would allow them. Key facts for SC-500:

Topic Fact

Who creates them? Azure manages them; you generally cannot author arbitrary deny assignments in IAM like a custom role

  • Where you see them Access control (IAM) → Deny assignments tab
  • Common sources Deployment stacks protecting managed resources; certain managed experiences

Compared to locks Locks are resource management restrictions for all users; deny assignments are permission-system denials that can target principals and actions more granularly

Compared to Policy Deny Policy Deny blocks noncompliant resource configuration on write; deny assignments block authorized actions for principals

When troubleshooting “I have Owner but still cannot delete,” check locks , deny assignments , and Policy , in that mental order.

Combining locks and RBAC in real designs

Production RG: Contributors deploy apps; CanNotDelete on the RG and on shared Key Vault/SQL; Owner only via PIM eligible assignment.

Platform subscription: Hub VNet and firewall get CanNotDelete ; network admins get Network Contributor at RG, not subscription Owner.

Audit: Security Readers view Defender; they do not get Contributor “to make reading easier.”

Break glass: Two User Access Administrator / Owner accounts protected with PIM, monitored, not used daily.

Exam traps

Believing Contributor can remove locks .

Thinking ReadOnly lock stops SQL row updates or blob data-plane deletes in all cases.

Confusing User Access Administrator (manage access) with Contributor (manage resources).

Assigning Owner when Contributor + separate UAA would better separate duties.

Forgetting lock inheritance when a child resource “mysteriously” cannot be deleted.

Locks stop accidents; RBAC stops unauthorized people; Policy stops bad configurations; deny assignments are the platform’s hard blocks—SC-500 expects you to pick the right layer.