由于azure-storage-blob的新更新,blockblobservice已弃用
如何检查斑点是否存在?
这个答案不适用于新版本的Azure-storage-blob使用python进行更快的Azure blob名称搜索吗?
我在GitHub上发现了这个问题:https : //github.com/Azure/azure-sdk-for-python/issues/12744
2020-09-10发布的12.5.0版本现在已exists
在新的SDK中使用了该方法。
例如,
同步:
from azure.storage.blob import BlobClient
blob = BlobClient.from_connection_string(conn_str="my_connection_string", container_name="mycontainer", blob_name="myblob")
exists = blob.exists()
print(exists)
异步:
import asyncio
async def check():
from azure.storage.blob.aio import BlobClient
blob = BlobClient.from_connection_string(conn_str="my_connection_string", container_name="mycontainer", blob_name="myblob")
async with blob:
exists = await blob.exists()
print(exists)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句