Flickering issue: Blob metadata not updating via Python SDK despite successful response

Roman Fedorenko 30 Reputation points
2025-09-29T12:39:12.0433333+00:00

We are encountering an inconsistent issue when setting blob metadata using the Azure Storage Python SDK.

When we send metadata updates for a blob, the SDK call completes successfully, and the response indicates the blob was modified. However, in reality:

The blob metadata is not updated.

The Azure Portal UI continues to show empty metadata.

Occasionally, the metadata does update correctly (the issue is intermittent/flickering).

This makes it difficult to reliably set metadata, as the SDK and service responses do not match the actual blob state.

Expected Behavior

When metadata is set via the Python SDK, the blob’s metadata should always be updated and visible both programmatically and in the Azure Portal.

Actual Behavior

The SDK reports success, but often the blob metadata remains unchanged (empty). Only occasionally does the metadata actually get applied.

Environment:
Azure Storage Blob Python SDK - version = "12.22.0"
Python version: 3.12.3

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
{count} votes

Answer accepted by question author
  1. Praveen Bandaru 8,770 Reputation points Microsoft External Staff Moderator
    2025-09-29T15:38:29.9633333+00:00

    Hello Roman Fedorenko
    I see you're encountering a flickering issue when updating blob metadata with the Azure Storage Python SDK. It can be frustrating when the SDK reports success, but the metadata doesn't update as expected.

    Check that you're using the latest version of the Azure Storage Blob Python SDK, as newer releases may resolve such issues.

    • If you're working with asynchronous methods, make sure you're properly awaiting the set_blob_metadata call, as missing awaits can cause problems.

    Make sure the metadata you're sending is correctly formatted as a dictionary of key-value pairs (strings). For example:

    metadata = {"key1": "value1", "key2": "value2"}

    await blob_client.set_blob_metadata(metadata)

    If there's an active lease on the blob, include the correct lease ID in your metadata update call.

    Consider using the if_unmodified_since parameter to ensure updates only occur if the blob hasn't changed since a certain time, which can help avoid conflicts.

    After updating, double-check the metadata in the Azure Portal, as UI caching may delay visible changes. Also, enable logging in the SDK to capture any errors or useful details for troubleshooting.

    And also check known issue also there in the below document:

    https://free.blessedness.top/en-us/python/api/overview/azure/storage?view=azure-python#known-issues

    https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/storage/azure-storage-blob/CHANGELOG.md


    Hope the above answer helps! Please let us know do you have any further queries.

    Please do not forget “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.