Infrastructure
Azure Blob Storage: restore a version after an overwrite without losing newer writes
A runbook for qualifying a blob version, containing writers and restoring content without overwriting a concurrent correction.
An application stores a configuration file in Azure Blob Storage. Following a deployment, the current file is invalid. An earlier version looks healthy, but an operator or application may already be correcting the file. Blindly restoring the older version under the same name could erase that work.
In this fictional case, versioning was enabled before the overwrite. The goal is to restore validated content, not to assume that every subsequent change can be discarded.
Contain the incident and establish the facts
Assign an incident owner and record the account, container, exact blob name, UTC time window and affected consumers. Pause deployments and automated writes to this object using the established operational control; verify that writers have actually stopped. Existing reads or application caches may still serve older content, so inventory those paths too.
Record the current blob’s ETag and properties, plus the version ID, timestamp and size of each candidate. Preserve available logs and the suspected change identifier without exposing sensitive content. An ETag is a concurrency token, not proof of business identity or file integrity. Export the current content to a protected quarantine location before restoring anything: it may contain a correction that needs reconciliation.
If versioning was not enabled at the time of the overwrite, the desired version has expired, or access is denied, stop and assess the protections actually available, such as a backup or soft delete. Do not assume they cover this overwrite.
Select and test a version away from production
List versions for the exact blob and associate each candidate with a known change. Download or copy the selected version to an isolated temporary name, with appropriate access and retention controls. Compare it with the current file and the last expected state: syntax, settings, dependencies and any sensitive data. An earlier timestamp alone does not establish that a configuration is healthy.
Have the application owner review the diff. Test the candidate in an isolated environment or with a validator that cannot affect live systems. Identify legitimate changes made since that version; when necessary, reconstruct a corrected file instead of restoring the old one unchanged.
Blob versioning protects blob versions, not the complete application state or effects already produced. Separately check required metadata, HTTP properties and permissions, as well as account compatibility and the limitations of the deployed configuration.
Restore with concurrency protection
Immediately before writing, reread the destination properties and compare its ETag with the value observed after quarantine. If it changed, do not overwrite it: identify the new writer, compare its content and seek approval again.
Use a supported copy or write operation with a condition on the observed destination ETag and a source identified by its immutable version ID. A source-only condition does not protect the destination. If the chosen tool cannot set a destination condition, a preliminary read is not an equivalent safeguard: keep writers stopped and use a suitable serialization mechanism that the team has tested and authorized.
A failed precondition calls for reassessing the destination, not a forced retry. For an asynchronous copy, track its status to completion before resuming consumers. Record the copy ID, version IDs and ETags before and after the operation, without logging access tokens.
Validate, resume or roll back
Read the current blob again and verify its content, properties and, where useful, a calculated digest. Then validate a canary consumer, errors and logs; check any cache invalidation or reload required before expanding traffic. Re-enable writers progressively with their owner and monitor for a predefined window.
If content or behavior is still wrong, keep writes paused. The quarantine copy and the version created during the intervention are rollback candidates, not instructions to restore automatically: compare them with the current state and apply concurrency protection again. Reconcile business processing and effects that occurred during the incident separately.
Make the final decision explicit: resume after validation, correct the candidate in quarantine, or escalate to the backup procedure. If the version, permissions or absence of concurrent writes cannot be established, do not replace the blob.