无法使用Python SDK从Azure非公共Blob存储下载

时间:2019-05-03 14:07:38

标签: python-3.x azure-storage azure-storage-blobs

在尝试使用适用于Python的Azure存储SDK从Azure非公共Blob存储下载文件时,获取对象没有属性“读取”

blob_service = BlockBlobService(account_name = account_name, account_key = blob_key)
    blob_service.get_blob_to_path(container_name,remote_file_name,local_file_name)

我生成了带有失效日期的SAS令牌,但是没有信息如何与 BlockBlobService 一起使用?对于公共文件,它工作正常。

1 个答案:

答案 0 :(得分:2)

您实际上可以使用以下语法:

bbs = BlockBlobService(account_name='<account_name>', sas_token='<sas_token>')

更多信息可以在此repo

中找到

当涉及“读取”时,请确保SAS也具有读取blob服务的所有必需访问权限(值得仔细检查): enter image description here