![](/img/trans.png)
[英]How to read json file from blob storage using Azure Functions Blob Trigger with Python
[英]How to read a file from Azure Blob Container using Python
如何使用 Python 读取 Azure blob 容器中的文件? 我试图读取容器中的一些 JSON 文件以将它们展平。
我是 Azure 的新手,对此不太了解。 我可以使用“BlobServiceClient”连接到容器。 但是,我不确定如何从容器中的文件夹中读取文件
谢谢
如果想用python从Azure blob中读取文件,请参考以下代码
from azure.storage.blob import BlobServiceClient
connection_string=''
blob_service_client = BlobServiceClient.from_connection_string(connection_string)
container_client = blob_service_client.get_container_client("<container name>")
blob_client = container_client.get_blob_client("<blob name>")
blob_client.download_blob().readall() # read blob content as string
更多详情请参考文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.