Management and Governance Management locks verified

ReadOnly lock

A ReadOnly lock is Azure’s strongest everyday guardrail against accidental changes. It says, “you can look, but you cannot change or delete,” even when the person normally has powerful permissions. Teams use it on production resource groups, shared infrastructure, and critical services when a mistaken portal click, script, or deployment could create an outage. It is not the same as the Reader role; it is a lock on the resource scope itself. Removing it should require a deliberate change record, owner approval, and a check for blocked automation.

Aliases
ReadOnly management lock, read-only resource lock, Azure ReadOnly lock, ARM ReadOnly lock
Difficulty
intermediate
CLI mappings
4
Last verified
2026-05-21

Microsoft Learn

A ReadOnly lock is an Azure Resource Manager management lock that lets authorized users read a resource, resource group, subscription, or management group scope but prevents updates and deletes. The restriction applies across role assignments, including Owner, until the lock is removed or changed.

Microsoft Learn: Lock your Azure resources to protect your infrastructure2026-05-21

Technical context

In Azure architecture, a ReadOnly lock sits in the Azure Resource Manager control plane. It can be applied at management group, subscription, resource group, or resource scope, and child resources inherit the restriction from parent scopes. The lock blocks control-plane write and delete operations against the locked scope, while read operations continue. It affects portal changes, ARM and Bicep deployments, REST calls, Azure CLI, and automation identities. For some services, the lock can also interfere with control-plane operations that indirectly support data access, such as listing storage account keys.

Why it matters

ReadOnly locks matter because high-privilege access is common in real Azure estates, and production mistakes often happen through routine tooling rather than malicious intent. A lock gives platform owners a hard pause before infrastructure is changed, especially for shared networking, identity dependencies, landing-zone resources, and systems under audit. It also forces teams to separate viewing from changing. The tradeoff is real: deployments, scaling changes, key rotation workflows, and repair scripts can fail until the lock is removed. Good use of ReadOnly locks requires ownership, documentation, monitoring, and a clean break-glass process, not just applying the lock and hoping people remember it.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

The Locks blade for a subscription, resource group, or resource shows ReadOnly entries, notes, inheritance, and whether the current user can remove them during change windows.

Signal 02

Azure CLI or Resource Graph output shows lock level, lock name, scope, and notes when deployment preflight checks search for inherited restrictions across production subscriptions.

Signal 03

ARM, Bicep, Terraform, or portal changes fail with authorization-like errors when a parent ReadOnly lock blocks updates despite otherwise valid RBAC permissions during release validation.

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Freeze a production resource group during a critical retail season so portal edits and ad hoc scripts cannot change live infrastructure.
  • Protect hub networking, private DNS, or shared identity resources where one mistaken update could disrupt many application teams.
  • Preserve audit-controlled infrastructure while allowing auditors, support teams, and engineers to inspect configuration evidence safely.
  • Prevent accidental deletion or mutation of migration landing zones while cutover teams validate dependencies and rollback paths.
  • Force change-window discipline by requiring explicit lock removal, documented approval, and lock restoration around risky maintenance.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

Manufacturing plant protects hub network changes during cutover

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A global manufacturer was moving plant telemetry systems into Azure and needed to protect the shared hub network during a weekend cutover. Multiple vendors had temporary Contributor access for validation.

Business/Technical Objectives
  • Prevent accidental edits to hub virtual network, firewall, and private DNS resources.
  • Allow engineers and vendors to inspect settings during the cutover.
  • Keep a documented break-glass path for approved emergency changes.
  • Restore the same protection after every maintenance window.
Solution Using ReadOnly lock

The platform team applied ReadOnly locks at the hub-networking resource group and on a shared private DNS zone. They kept vendor access at Reader where possible and used Privileged Identity Management for temporary lock removal rights assigned only to the platform lead. Azure CLI preflight checks listed locks before every deployment task, and the change ticket stored JSON output showing lock IDs, scopes, and notes. When the team needed to add one firewall rule, the lead removed the specific resource-group lock, applied the approved Bicep deployment, validated connectivity from the plant gateway, and recreated the lock with the original name and reason. Activity Log alerts watched for lock delete events during the cutover.

Results & Business Impact
  • No hub networking resource was changed outside the approved deployment window.
  • Cutover validation finished in nine hours instead of the planned twelve.
  • Three attempted portal edits were blocked before they reached shared infrastructure.
  • Audit evidence showed every lock removal, restoration, scope, and approver.
Key Takeaway for Glossary Readers

ReadOnly locks are most valuable when they protect shared blast-radius resources and are paired with a disciplined removal-and-restore process.

Case study 02

University research platform freezes grant-funded storage configuration

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A university research office hosted grant-funded datasets in Azure Storage and needed to stop accidental configuration drift during a federal reporting period. Researchers still needed visibility into settings and cost evidence.

Business/Technical Objectives
  • Prevent storage account firewall, redundancy, and lifecycle-policy changes during reporting.
  • Allow research administrators to review configuration without submitting tickets.
  • Keep storage data access controlled through Microsoft Entra roles.
  • Avoid blocking approved retention and compliance evidence exports.
Solution Using ReadOnly lock

The cloud governance team applied a ReadOnly lock to the storage account resource, not the whole resource group, because other resources still required routine updates. They confirmed that researchers used Microsoft Entra data-plane roles instead of shared keys, since the lock would block some management operations around key access. Azure CLI produced lock inventory reports for the grant file, while Azure Policy enforced required tags and diagnostic settings. During one approved lifecycle-policy adjustment, the team removed the lock for fifteen minutes, applied the policy change from source-controlled Bicep, validated the Activity Log, and restored the lock with a note referencing the grant control.

Results & Business Impact
  • Configuration drift findings dropped from seven in the prior quarter to zero.
  • The reporting package included lock evidence without granting researchers write access.
  • Approved maintenance completed without broad subscription-level restrictions.
  • Support tickets about unexplained portal write failures decreased after the team published the lock runbook.
Key Takeaway for Glossary Readers

A narrowly scoped ReadOnly lock can protect regulated configuration while leaving unrelated resources available for normal operations.

Case study 03

Energy analytics team prevents accidental deletion during asset sale

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

An energy company was divesting one analytics platform and needed to preserve Azure resources while legal, finance, and engineering teams reviewed ownership. The resources could not be changed until the buyer accepted the final inventory.

Business/Technical Objectives
  • Stop deletes, resizes, and endpoint changes during due diligence.
  • Keep read access open for legal inventory and architecture review.
  • Document every exception requested by engineering teams.
  • Avoid blocking unrelated analytics projects in the same subscription.
Solution Using ReadOnly lock

The Azure operations team moved the divestiture resources into a dedicated resource group and applied a ReadOnly lock there. They used Azure Resource Graph and CLI lock exports to create a daily evidence pack listing resources, tags, costs, and lock state. Data-plane access was separately limited through Key Vault, Storage, and database roles, because the lock protected management changes rather than business data. When engineering discovered a required diagnostic-setting update, the change board approved a temporary lock removal, the update ran through an existing deployment pipeline, and the lock was restored immediately afterward. The team also added Activity Log alerts for lock delete and write failures.

Results & Business Impact
  • The final resource inventory matched the buyer review snapshot exactly.
  • No accidental resource deletion occurred during the eight-week divestiture period.
  • Two unauthorized deployment attempts failed safely and generated alerts.
  • Finance avoided broad subscription freezes that would have delayed other analytics work.
Key Takeaway for Glossary Readers

ReadOnly locks help preserve the state of sensitive infrastructure during ownership, legal, or audit events when change control matters more than speed.

Why use Azure CLI for this?

Use Azure CLI for ReadOnly locks because lock state needs to be checked exactly, not guessed from a portal blade. In my experience, locks cause the hardest incidents when an engineer sees a failed deployment, assumes RBAC is wrong, and misses an inherited lock at a parent scope. CLI lets you list locks at the precise scope, capture JSON evidence, compare subscriptions, and automate preflight checks before deployments. It is also safer for change windows: you can remove one named lock, apply a change, and recreate the same lock with notes, rather than clicking through multiple blades under pressure. consistently.

CLI use cases

  • List inherited locks at a deployment scope before running ARM, Bicep, Terraform, or release-pipeline changes.
  • Create a named ReadOnly lock with notes after production stabilization or compliance approval.
  • Export lock inventory across subscriptions for audit evidence and stale-control cleanup.
  • Remove one approved lock during a maintenance window, then recreate it with the same scope and reason.
  • Compare lock state before and after migration, restore testing, or platform-team ownership transfer.

Before you run CLI

  • Confirm tenant, subscription, target scope, resource group, and whether the lock is inherited from a parent management group or subscription.
  • Verify your identity has Microsoft.Authorization/locks permissions; Owner can be blocked from resource changes but still may remove locks.
  • Use read-only list commands first because deleting the wrong parent lock can expose many child resources to unexpected changes.
  • Check planned deployments, backup jobs, key rotation, scaling operations, and resource moves that might fail while ReadOnly remains active.
  • Choose JSON output for evidence, including lock ID, level, scope, notes, and timestamps stored in the change ticket.

What output tells you

  • level confirms whether the lock is ReadOnly or CanNotDelete, which determines whether updates are blocked or only deletion is blocked.
  • scope shows exactly where the restriction is applied and which child resources inherit the lock during deployments or portal changes.
  • notes usually explain business justification, maintenance owner, or ticket number; missing notes are a signal for governance cleanup.
  • id gives the full Azure Resource Manager path, which is useful for deleting the intended lock and avoiding display-name ambiguity.
  • Empty output at the resource scope does not prove safety; parent-scope locks can still block the same operation through inheritance.

Mapped Azure CLI commands

Management locks

direct
az lock list --scope <scope> --output table
az lockdiscoverManagement and Governance
az lock show --name <lock-name> --scope <scope>
az lockdiscoverManagement and Governance
az lock create --name <lock-name> --lock-type ReadOnly --scope <scope> --notes "<reason>"
az locksecureManagement and Governance
az lock delete --name <lock-name> --scope <scope>
az lockremoveManagement and Governance

Architecture context

A seasoned Azure architect treats a ReadOnly lock as a temporary or deliberately governed control, not a replacement for RBAC, Azure Policy, or deployment discipline. It belongs around resources where unexpected mutation creates broad blast radius: hub networking, shared private DNS zones, production storage accounts, key infrastructure resource groups, and compliance-protected workloads. The lock is inherited, so its scope choice matters. Put it too high and normal operations stall; put it too low and risky child resources remain changeable. In landing zones, I normally pair locks with documented ownership, policy exemptions, break-glass role activation, and pipeline preflight checks so the guardrail protects production without silently blocking legitimate maintenance.

Security

Security impact is direct because a ReadOnly lock constrains what even authorized users can do through Azure Resource Manager. It reduces accidental or unauthorized configuration drift, firewall weakening, key-regeneration changes, and deletion of protected resources. It does not remove existing data-plane access, revoke secrets, or replace least-privilege role assignments. On services such as Storage, the lock may block management operations like listing keys, which changes how users access data through the portal or scripts. The remaining risk is operational: too many people with lock-delete permission, undocumented exceptions, or emergency removal without audit evidence can turn the lock into theater instead of control.

Cost

A ReadOnly lock has no direct Azure meter, but it affects cost through operations and blocked optimization. It can prevent accidental deletion of paid resources, which is good when the resource is critical and bad when an idle protected resource keeps billing for months. It can also block resizing, SKU changes, storage cleanup, diagnostic-setting edits, or lifecycle changes that FinOps teams need to control spend. Cost ownership should include a lock inventory, an owner tag, and an approval path for optimization work. The hidden cost is engineering time spent diagnosing failed deployments or repeated manual approvals because lock governance was not documented.

Reliability

Reliability impact is direct but double-edged. A ReadOnly lock can prevent accidental deletion, resize, firewall edits, public access changes, and deployment drift on resources that production systems depend on. That protects uptime and reduces blast radius. The same lock can also block legitimate repair, scale, failover preparation, certificate updates, or deployment rollback if teams discover it only during an incident. Reliable use means operators know where locks exist, which parent scope created them, how to remove and restore them safely, and which automated jobs need a maintenance window. Locks should be monitored as part of operational readiness, not hidden tribal knowledge.

Performance

Runtime performance is usually indirect because a ReadOnly lock controls management operations, not request latency inside the service. The performance risk appears when the lock blocks tuning changes that production needs: scale-out, SKU upgrades, connection setting changes, firewall updates for a new private endpoint, or deployment of a performance fix. It can also slow operational performance when every pipeline run fails late instead of checking lock state early. Good teams use CLI or Resource Graph checks before release, expose locks in monitoring workbooks, and treat lock removal as a controlled maintenance step so performance work is not delayed by avoidable governance friction.

Operations

Operators inspect ReadOnly locks before deployments, migrations, incident changes, and resource moves. The practical workflow is to list inherited locks, identify the exact scope, record the lock name and notes, confirm who can delete it, and decide whether the change truly requires removal. In production, teams should automate lock checks inside release pipelines and maintenance runbooks so a failed deployment does not become a detective exercise. After a change, operators should recreate the lock with the original scope and reason, then capture evidence for the ticket. Good operations also include stale-lock reviews, because abandoned locks can block modernization work months later.

Common mistakes

  • Assuming Contributor or Owner can change a locked resource without first removing the management lock.
  • Applying ReadOnly at a broad subscription scope and then wondering why unrelated deployment pipelines fail.
  • Forgetting that management locks can affect control-plane helper operations such as listing storage account keys.
  • Removing a lock for maintenance and failing to recreate it with the same scope, notes, and owner evidence.
  • Treating locks as security boundaries while leaving excessive RBAC, exposed data-plane access, or unmanaged break-glass accounts unchanged.