The storage account contosomedia is the source account in an active object replication policy. Blob versioning is enabled. An application overwrites some blobs many times each day, and several blobs now have more than 5,000 versions.
Users report that listing blobs has become slow, and storage costs are rising. You have these requirements:
- Object replication must continue to work.
- Users must still be able to recover blobs that were overwritten recently.
- Reduce cost and listing latency with minimal ongoing administrative effort.
What should you do?
Repeated blob overwrites can accumulate many versions, increasing storage costs and listing latency. Microsoft recommends keeping fewer than 1,000 versions per blob. A lifecycle management policy can delete older previous versions automatically. Versioning stays enabled, which is required because it cannot be disabled while an object replication policy is active.
- Not correct: Apply an Azure Resource Manager lock to contosomedia. A lock protects the account from accidental deletion. It does not limit the number of versions per blob, so cost and listing latency do not improve.
- Not correct: Replace versioning with a scheduled task that takes blob snapshots each hour. Versioning cannot be disabled while the replication policy exists. Snapshots are not replicated, and Microsoft recommends you stop taking block blob snapshots once versioning is enabled.
- Not correct: Delete the object replication policy, disable blob versioning, and then create the policy again. Object replication requires versioning, so the policy cannot be recreated with versioning disabled. Replication would stop, which breaks a requirement.
- Not correct: Disable blob versioning on contosomedia. You cannot disable versioning while object replication policies are in effect on the account. Disabling it would also remove protection for future overwrites.
- Correct: Create a lifecycle management policy that automatically deletes previous versions after they reach a set age. Automatically deleting old versions keeps the version count per blob low, which reduces cost and listing latency. Versioning stays enabled, so replication continues and recent overwrites can be recovered.
- Blob Versioning in Azure Storage - Azure StorageMicrosoft Learn
- Object replication overview - Azure StorageMicrosoft Learn