简体   繁体   English

如何使用 python 中的 DataLakeServiceClient 获取 Azure 中存在的容器列表

[英]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.

相关问题 Azure DataLakeServiceClient Python - 如何追加,如何设置偏移量和冲洗长度? - Azure DataLakeServiceClient Python - How to append, How to set Offset and Flush Length? azure - 在 python 中列出容器 - azure - list containers in python 使用Python列出具有特定名称类型的Azure容器 - List azure containers with specific name type using Python 如何使用Python使用扩展容器获取HTML? - How to get HTML with expanded containers using Python? 如何在 databricks 工作区中使用 python 获取 azure 数据湖存储中每个文件的最后修改时间? - How to get the last modification time of each files present in azure datalake storage using python in databricks workspace? 使用Python有效地将多个azure容器复制到新创建的容器 - Copy multiple azure containers to newly created containers efficiently using Python 如何使用 python SDK 获取 Azure FunctionApp 列表 - How to get Azure FunctionApp list using python SDK 如何使用python从日志文件中的ip地址列表中获取唯一的ip地址? - how to get unique ip address from list of ip address present in log file using python? 如果使用 python 的列表中不存在值,如何忽略? - How to ignore if a value is not present inside a list using python? Azure Blob 存储与 Python,创建容器但不列出它们? - Azure Blob Storage with Python, create containers but not list them?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM