Skip to content

Instantly share code, notes, and snippets.

@thehappycheese
Created November 2, 2022 06:11
Show Gist options
  • Save thehappycheese/6c985b1ab0cd69f41b33af75a0940cd1 to your computer and use it in GitHub Desktop.
Save thehappycheese/6c985b1ab0cd69f41b33af75a0940cd1 to your computer and use it in GitHub Desktop.
How to use fsspec with Azure Blob Storage Account
# Must use the async io variant of Azure Credentials
from azure.identity.aio import DefaultAzureCredential
# fsspec directly, use this library which implements it and gives better type hints and autocompletion
import adlfs
cloud_filesystem = adlfs.AzureBlobFileSystem(
account_name="<STORAGE_ACCOUNT_NAME>",
credential=DefaultAzureCredential()
)
# list objects
cloud_filesystem.ls(f"<CONTAINER_NAME>/some/path/", detail=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment