How can I extract Last Modified Date in MS Azure for a blob in my blob storage

天涯浪子 提交于 2019-12-05 18:19:52

It sounds like that you want to get the last_modified property of a blob on Azure using Python in Azure ML Studio. Please try to use the code below.

for blob in generator:
    last_modified = blob.properties.last_modified
    print(last_modified)

And you can try to code <object>.__dict__ in Python interactive env to show the properties of a Python object if you are not sure what property whether or not exists, for example as below.

# Show the properties of a Blob object
>>> blob.__dict__
{'content': '', 'metadata': {}, 'snapshot': None, 'name': 'test.tmp',
 'properties': <azure.storage.blob.models.BlobProperties object at 0x7f4f8f870110>}
# Show the properties of the BlobProperties Object
>>> blob.properties.__dict__
{'content_length': 99831, 'blob_type': 'BlockBlob', 'append_blob_committed_block_count': None, 
 'last_modified': datetime.datetime(2016, 11, 23, 5, 46, 10, tzinfo=tzutc()), 'content_range': None, 'etag': '"0x8D4136407173436"', 'page_blob_sequence_number': None, 'content_settings': <azure.storage.blob.models.ContentSettings object at 0x7f4f8f870510>, 'copy': <azure.storage.blob.models.CopyProperties object at 0x7f4f8f870650>, 'lease': <azure.storage.blob.models.LeaseProperties object at 0x7f4f8f870810>}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!