[英]How to get list of Containers present in Azure using DataLakeServiceClient in python
from azure.storage.filedatalake import DataLakeServiceClient service_client = DataLakeServiceClient(account_url="{}://{}.dfs.core.windows.net".format( "https", storage_account_name), credential=storage_account_key) containers = service_client.list_containers() for c in containers: print (c.name)从 azure.storage.filedatalake 导入 DataLakeServiceClient service_client = DataLakeServiceClient(account_url="{}://{}.dfs.core.windows.net".format("https", storage_account_name), credential=storage_account_key) 容器 = service_client.list_containers () 用于容器中的 c:打印 (c.name)
But I am Getting an error like this: AttributeError: 'DataLakeServiceClient' object has no attribute 'list_containers'但我收到这样的错误: AttributeError: 'DataLakeServiceClient' object has no attribute 'list_containers'
service_client = DataLakeServiceClient(account_url="{}://{}.dfs.core.windows.net".format( "https", storage_account_name), credential=storage_account_key) containers = service_client.list_file_systems() for c in containers: print (c.name) service_client = DataLakeServiceClient(account_url="{}://{}.dfs.core.windows.net".format("https", storage_account_name), credential=storage_account_key) containers = service_client.list_file_systems() for c in containers: print (c.name)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.