

def create_directory():įile_system_client.create_directory("my-directory") This example adds a directory named my-directory to a container.

def create_file_system():įile_system_client = service_client.create_file_system(file_system="my-file-system")Ĭreate a directory reference by calling the FileSystemClient.create_directory method. This example creates a container named my-file-system. You can create one by calling the FileSystemDataLakeServiceClient.create_file_system method. Create a containerĪ container acts as a file system for your files. "https", storage_account_name), credential=credential)įor more examples, see the Azure identity client library for Python documentation. Service_client = DataLakeServiceClient(account_url=".".format( def initialize_storage_account(storage_account_name, storage_account_key): This example creates a DataLakeServiceClient instance by using an account key. This is the easiest way to connect to an account.

To use the snippets in this article, you'll need to create a DataLakeServiceClient instance that represents the storage account. import os, uuid, sysįrom import DataLakeServiceClientįrom re._match_conditions import MatchConditionsįrom ._models import ContentSettings pip install azure-storage-file-datalakeĪdd these import statements to the top of your code file. Install the Azure Data Lake Storage client library for Python by using pip.

See Get Azure free trial.Ī storage account that has hierarchical namespace enabled. Package (Python Package Index) | Samples | API reference | Gen1 to Gen2 mapping | Give Feedback PrerequisitesĪn Azure subscription. To learn about how to get, set, and update the access control lists (ACL) of directories and files, see Use Python to manage ACLs in Azure Data Lake Storage Gen2. This article shows you how to use Python to create and manage directories and files in storage accounts that have a hierarchical namespace.
