Skip to content

BlobStorage Versioning

Tore Nestenius edited this page Dec 5, 2024 · 2 revisions

Blob Versioning Tool Documentation

This tool provides functionality to work with Azure Blob Storage versioning. It allows you to create a versioned blob by overwriting it multiple times and to read all versions of a blob, displaying the content and metadata. Below are the details of its two core functions.


Core Functions

1. Write a Versioned Blob

This function creates a blob and overwrites it multiple times, generating new versions with each overwrite. Each version contains unique content and is timestamped.

How It Works:

  • A blob named VersionedBlob.txt is created in the specified container.
  • The blob's content is updated 10 times, with a 1-second delay between each write operation.
  • Each write creates a new version of the blob.

Purpose:

This feature helps you simulate multiple blob versions for testing or debugging purposes and for better understanding how blob versioning works.

How to Use:

  • Fill out the required details in the Storage Account Name, Container Name, and SAS Token fields.
  • Click the Create Versioned Blob button.
    A message will confirm that the blob was created and overwritten 10 times. Please note that this operation takes 10 seconds to complete.

2. Read and Display Blob Versions

This function retrieves all versions of the specified blob, including their metadata and content, and displays them in a tabular format.

How It Works:

  • All blob versions, including the latest version, are fetched using the Azure Blob Storage SDK.
  • The metadata displayed includes:
    • Version ID
    • Content
    • IsDeleted (indicates if the version is deleted)
    • IsLatestVersion (indicates if the version is the currently active version)
  • The versions are sorted with the latest version at the top.

Purpose:

This feature provides insight into the history of a blob's updates and helps with debugging or version tracking.

How to Use:

  • Fill out the required details in the Storage Account Name, Container Name, and SAS Token fields.
  • Click the Get Versions button.
  • The tool will display all versions in a table, highlighting the latest version.

Example Use Cases

  1. Simulating Blob Changes:
    Quickly create multiple blob versions for testing lifecycle management policies or version recovery.

  2. Debugging:
    Inspect the history of a blob’s updates and verify the contents of each version.

  3. Version Management:
    Use the version listing to identify and manage older or obsolete versions of a blob.


Notes

  • Ensure that Blob Versioning is enabled in the Azure Storage account's Data Protection settings before using the tool.
  • This tool requires a valid SAS Token or Managed Identity with appropriate permissions to access the storage account.
  • Deleted versions are indicated in the output but are retained unless explicitly removed.

For more information, refer to the Azure Blob Storage Documentation.

Clone this wiki locally