Azure / azure-storage-python

Microsoft Azure Storage Library for Python
https://azure-storage.readthedocs.io
MIT License
339 stars 241 forks source link

Get Blob URL in Blob Properties #503

Closed priyaananthasankar closed 6 years ago

priyaananthasankar commented 6 years ago

blob

azure-storage-blob==1.3.1

If Blob properties can support a get Blob URL interface it would help to provide it to machine learning libraries as a destination to save models. Or in general, blob URI can be a destination for any kind of save. This URI can be manually constructed but Python SDK can return it as a blob property. S3 supports such interfaces.

zezha-msft commented 6 years ago

Hi @priyaananthasankar, thanks for reaching out!

I see that you have already posted another issue about the same topic. Maybe I did not understand what you are trying to suggest. Doesn't the method make_blob_url do what you want? Please let me know. 😄

priyaananthasankar commented 6 years ago

Hi @zezha-msft Yes my bad, sorry i thought I haven't raised an issue yet. make_blob_url is what I need. Is there a reason it's part of a blob service than the blob properties? Just wondering. I searched for it in Blob class, somehow I assumed its modeled the same way as in Azure. Would be great to understand why.

zezha-msft commented 6 years ago

Hi @priyaananthasankar, in order to access a blob without the shared key, you need to first generate a SAS token and construct the blob URL with it. Since the SDK already has a flat structure, where all the methods are on the service object, we chose to put both the SAS generation method and this make_url method on the blob service.

Please let me know if you have any other question.