How to Enable Azure Blob Versioning and Restore a Previous Version

November 10, 2026

Blob versioning preserves earlier states of stored objects so an accidental overwrite does not have to become permanent data loss. This guide walks through enabling it and proving recovery with a disposable text file before you rely on it for production.

Documentation reviewed: 10 November 2026. These instructions were verified against the Microsoft sources below; Guava has not independently executed this procedure in a live environment.

Prerequisites and costs

  • An Azure subscription and a supported storage account. This walkthrough uses standard general-purpose v2 storage and block blobs.
  • Hierarchical namespace must be disabled. Azure Data Lake Storage accounts with hierarchical namespace are not supported for blob versioning.
  • Management permission to update blob service settings, such as Storage Account Contributor scoped to the account. That role can access account keys; grant it deliberately.
  • For the exercise using Microsoft Entra authorization, Storage Blob Data Contributor at the test container or account, plus at least Azure Resource Manager Reader access for portal navigation. Management access and blob data access are separate.
  • An approved connection to the account under its networking rules. Do not make a private account public to complete a tutorial.

There is no Microsoft 365 license requirement. Azure storage and operations can incur charges, including retained versions. Review the existing lifecycle policy and agree on retention before enabling this on a busy account.

1. Enable versioning

  1. In the Azure portal, open the correct storage account. Verify its subscription and resource group.
  2. Open Data management > Data protection.
  3. Under Tracking, select Enable versioning for blobs.
  4. Choose whether to retain all versions or delete them after an agreed period, and save the change. Reopen the page to confirm the setting persisted.

The deletion-period option creates a lifecycle-management rule. Afterward, that option may disappear from Data protection; review the rule under lifecycle management instead of assuming retention was lost. Avoid deleting existing lifecycle rules just to make the option reappear.

2. Create a controlled recovery exercise

Use a dedicated private test container and a unique filename, such as guava-versioning-check.txt. Confirm it does not already exist. Never use a production configuration file for the exercise.

  1. Create a local text file containing Version A - recovery baseline.
  2. Open the test container in the portal and use Upload to upload that file as a block blob.
  3. Select the uploaded blob and open its Versions tab. Record the version identifier and time.
  4. Edit the local file to contain Version B - changed content. Upload it again to the same container with the same name, accepting overwrite only after confirming this is your test blob.
  5. Refresh the version list. Identify the earlier version and the current version. Download the current blob and confirm it contains Version B.

This is a proposed validation exercise, not a report of a test Guava has run. Keep a short record of the account, container, blob name, version identifiers, and observed file contents.

3. Restore the earlier version and verify it

  1. In the blob’s Versions tab, select the earlier version recorded in the exercise.
  2. Choose Make current version. Check any confirmation carefully before proceeding.
  3. Refresh, then download the current blob again to a fresh local filename.
  4. Open that download and confirm it contains Version A. Check the actual contents; a familiar filename alone is not proof of recovery.

For a soft-deleted version, restore it first using Undelete on the blob’s Overview page. Undelete restores soft-deleted versions but does not make one current; promotion is a separate step.

In production, coordinate restoration with the application owner. Pause or control competing writes and validate the application’s behavior afterward. Restoring an old configuration can also reintroduce outdated values.

Troubleshooting

Problem Check
Access denied while browsing or uploading Confirm the data role, its scope, and the allowed network path. Being able to edit account settings does not establish Entra blob access.
No earlier version appears Verify the account, container, filename, and whether the exercise actually overwrote that blob after versioning was enabled. Review lifecycle deletion rules.
Undelete does not restore the current file Open Versions and promote the required restored version.
Recovered contents are wrong Stop further changes, preserve the version identifiers, and inspect the selected version before another promotion.

Retention, cleanup, and rollback

Disabling versioning stops new version creation but leaves existing versions in storage. It therefore does not immediately remove their costs. Object replication policies can prevent disabling it; do not delete a production replication policy merely to reverse this exercise.

Review retention with the data owner before deleting test versions or shortening lifecycle rules. Versioning does not protect against deletion of the container or storage account, and it is not a substitute for an independently planned backup strategy.

Related guides: configure lifecycle management, enable container soft delete, and protect Azure resources with a delete lock.

Sources

Microsoft Learn: upload and download block blobs in the portal covers the file-transfer controls used in the exercise.

Topics:
Read next
November 17, 2026

How to Enable Self-Service Password Reset in Microsoft Entra ID

Enable Microsoft Entra self-service password reset safely with a pilot group, strong recovery methods, registration prompts, testing, and hybrid writeback guidance.