Azure Blob immutability policies: choose retention or a legal hold
Azure Blob immutability policies protect data in a write once, read many (WORM) state: during the protected period, clients can read data but cannot modify or delete it. Use time-based retention when the retention period is known; consider a legal hold when the end date is not yet known. Immutability does not replace backups or access controls, and an incorrectly scoped or locked policy can block legitimate writes and deletion.
Azure Blob immutability policies: choose retention or a legal hold
Azure Blob immutability policies protect data in a write once, read many (WORM) state: during the protected period, clients can read data but cannot modify or delete it. Use time-based retention when the retention period is known; consider a legal hold when the end date is not yet known. Immutability does not replace backups or access controls, and an incorrectly scoped or locked policy can block legitimate writes and deletion.
This guide describes Azure Blob Storage container- and version-scoped WORM policies, the consequences of locking, and a safe test and verification sequence. Product details were checked against Microsoft documentation on 22 November 2026; interface labels and support depend on account configuration.
What immutability protects
Protected data remains readable, but cannot be overwritten or deleted while the policy applies. This makes it harder for a user, including a storage administrator, to change or remove protected data. It serves a different purpose from access control, backup, encryption, or disaster recovery. Excessive read access can still expose immutable data, and a separate recovery plan is still needed for a regional outage or account loss.
Azure provides two policy types:
| Policy | Ends when | Useful when | Caution |
|---|---|---|---|
| Time-based retention | The configured period expires | Records have a known retention period | Once locked, the period cannot be shortened and the policy cannot be deleted. |
| Legal hold | The hold is explicitly cleared | An investigation, litigation, or event has no known end date | Assign responsibility and a process for releasing the hold. |
Both can be applied at the same level. If the retention period expires while a legal hold remains, deletion is still blocked. A legal hold is not a promise to retain data forever: define who can release it and how the end of the matter is confirmed.
Choose the scope first
Scope determines the impact of a mistake and the effort needed to manage exceptions.
**Container-scoped WORM** protects blobs in a container together. It is straightforward when they share one retention rule and no per-blob exceptions are needed. You cannot assign a different immutability policy to each blob in that container.
**Version-scoped WORM** can protect individual blob versions, allowing finer control. Blob versioning is required, and the storage and cost of extra versions should be considered. A default policy at account or container level applies to new versions by default; it might not apply retroactively to existing versions.
When multiple policy levels apply, the more specific scope takes precedence in this order: blob version, container, then account. In the current documentation, accounts with hierarchical namespace enabled support container-scoped policies, but not version-scoped WORM. Accounts with NFS 3.0 or SFTP enabled do not support immutability policies. Check the actual account configuration before setup.
Example: retaining audit logs
Illustrative scenario: A team stores daily audit logs in an audit-archive container and wants to prevent changes or deletion for seven years from each log's creation date, based on an approved retention rule.
If every log follows the same rule and has no exceptions, container-scoped time-based retention may be easier to manage. If log types have different retention periods or specific versions need separate control, consider version scope. Seven years here is an assumption for illustration, not a statement of the legally appropriate period. Determine the actual period from applicable rules and the organization's records policy.
Prepare before locking
A time-based policy can initially be created unlocked for testing. An unlocked policy protects against overwrites but does not guarantee delete protection; its period can be shortened or the policy deleted. For the full immutable protection required by compliance scenarios, the policy must be locked. A locked container policy cannot be deleted, and its retention period may be extended but not reduced. Over its lifetime, a locked container-scoped policy can be extended up to five times.
Do not apply a lock directly to production data. First:
Define which data and blob types are covered, and whether existing data is affected.
Have records owners approve the period, its start point, and who may apply or clear legal holds.
In a test container, check upload, read, overwrite, metadata change, and delete behavior separately.
Check whether upload tools create a blob and then continue writing to that same blob; the policy can block later writes.
Review recovery and deletion procedures, operational ownership, audit log retention, and cost effects.
Lock the policy on the intended production scope only after results have been reviewed and approved.
To configure a container-scoped policy in the Azure portal, open the target container's Access policy page, add a policy under Immutable blob storage, and specify the time-based retention period. If you intend container scope, verify the version-level immutability option is not enabled. Portal labels can change; consult Microsoft's current setup documentation and perform locking separately, after testing and approval.
When a write pattern fails
Immutability is more than a “prevent delete” switch. Changes to protected content and user metadata are restricted too. In a container-scoped WORM container, outcomes for creating a blob, overwriting an existing path, changing properties, or creating a snapshot depend on policy state and period. Uploading again to an existing blob path can fail even though creating a new blob is allowed.
For workloads that continually append data, consider the protected append writes option. One setting can allow new blocks at the end of an append blob. A broader setting can also allow certain block-blob append patterns through Data Lake Storage API append-and-flush methods. Neither option permits changing or deleting existing blocks. Test that the SDK and upload method in use support the required API.
Microsoft recommends immutability mainly for block and append blobs. A page blob holding an active VM VHD may be unsuitable because writes can be blocked or versions can accumulate. Patterns such as SQL Backup to URL that create a blob and then write to it again can also fail under a policy.
Verify the policy and plan recovery
Check the test results against the intended behavior:
Confirm the account, container, and policy scope are correct.
Create and read a test blob, then confirm overwrite and deletion are rejected during the protected period.
Check application write paths that should remain available, including allowed append operations and metadata changes.
In the portal or a supported API, verify the retention period, lock state, legal-hold tags, and audit records.
Store Azure Activity Log and data diagnostic logs separately according to the organization's audit retention requirements.
Use Blob Inventory reports to periodically review policy coverage and version state.
A locked policy is not something an administrator can simply undo after a mistake. A container with a locked policy may be deletable only when empty, and account deletion may be restricted while protected data remains. If soft delete is also enabled, understand its recovery window and what happens when it expires. Before locking, review backup and recovery needs and the shutdown scenario; after locking, plan access, costs, and audit responsibilities through the end of the protected period.
Immutable storage can help address requirements in certain regulations, but enabling the feature does not by itself guarantee legal or regulatory compliance. Applicable rules, record classification, retention period, and evidence-handling requirements depend on jurisdiction and the work involved. Also, after a customer-managed failover, immutability changes made after the last sync may not have reached the secondary region; include a policy-state check after failover.
Sources
[Immutable storage for Azure Blob Storage overview](https://learn.microsoft.com/en-us/azure/storage/blobs/immutable-storage-overview)
[Container-level WORM policies for immutable blob data](https://learn.microsoft.com/en-us/azure/storage/blobs/immutable-container-level-worm-policies)
[Configure immutability policies for containers](https://learn.microsoft.com/en-us/azure/storage/blobs/immutable-policy-configure-container-scope)
[Configure immutability policies for blob versions](https://learn.microsoft.com/en-us/azure/storage/blobs/immutable-policy-configure-version-scope)