question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blob objects returned by list_blobs has None metadata properties

See original GitHub issue

azure-storage==0.32.0 Python 3.4.3 requests==2.10.0

If You use:

from azure.storage import CloudStorageAccount
ACC = CloudStorageAccount(account_name, account_key)
SRV = ACC.create_block_blob_service()
GEN = SRV.list_blobs(container_name)
for blob in GEN:
    print(blob.metadata)

to get list of blobs in container and their metadata, You will have:

None None None etc…

But if You use:

blob0 = SRV.get_blob_properties(container_name, blob_name)
print(blob0)

Everything is OK:

{‘val1’: ‘foo’, ‘val2’: ‘blah’}

In both cases we have azure.storage.blob.models.Blob object so there should be ‘metadata’ property as in Model.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
erezvani1529commented, Jun 28, 2016

Hi @smereczynski,

List blobs by default does not return metadata unless you specify “Metadata” in the “include” parameter when calling the method. Have you tried adding this parameter to your calls?

1reaction
smereczynskicommented, Jun 28, 2016

@erezvani1529 OK. Of course it works. Is there any plan to create some reliable documentation for Python SDK?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage blob properties and metadata with JavaScript
Learn how to set and retrieve system properties and store custom metadata on blobs in your Azure Storage account using the JavaScript client ......
Read more >
Accessing metadata from azure storage blob - Stack Overflow
The blob objects in blobs, show 0 for the metadata count. Each of the items HAVE metadata, verified by looking at the properties...
Read more >
Azure Blob Storage binding spec - Dapr Docs
The response body contains the value stored in the blob object. If enabled, the user defined metadata will be returned as HTTP headers...
Read more >
azure.storage.blob package - NET
create_container (name: str, metadata: Optional[Dict[str, str]] = None, ... Returns. An object containing blob service properties such as analytics logging, ...
Read more >
Azure Storage SDK for Go (Preview) - Go Packages
Properties or metadata in blob. ... ListBlobs returns an object that contains list of blobs in the container, pagination token and other information...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found