Skip to content

ADLFS (Azure Data Lake FileSystem)

Description:

  • Interact with Azure Data Lake

Resources:

This notebook reads its settings from environment variables. Set them before starting Jupyter:

  • ADLS_STORE_NAME: name of your Azure Data Lake store
  • AZURE_TENANT_ID: Azure AD tenant ID
  • AZURE_CLIENT_ID: client ID of a service principal with access to the store
  • AZURE_CLIENT_SECRET: client secret of that service principal

List the contents of a Azure store

import os
from fsspec import filesystem
from adlfs import AzureDatalakeFileSystem
# Note: this is the same as:
# adl = filesystem("adl")
# abfss = filesystem("abfss")
store_name = os.environ["ADLS_STORE_NAME"]
tenant_id = os.environ["AZURE_TENANT_ID"]
client_id = os.environ["AZURE_CLIENT_ID"]
client_secret = os.environ["AZURE_CLIENT_SECRET"]
adl = AzureDatalakeFileSystem(store_name=store_name, tenant_id=tenant_id, client_id=client_id, client_secret=client_secret)
adl.ls('')

ganymede is made by Eugo