Skip to content

Instantly share code, notes, and snippets.

@AnsonYe
Created August 22, 2017 07:20
Show Gist options
  • Save AnsonYe/10a30b604c37896b1907ece050109f37 to your computer and use it in GitHub Desktop.
Save AnsonYe/10a30b604c37896b1907ece050109f37 to your computer and use it in GitHub Desktop.
List all azure containers in python
from azure.storage.blob import BlobService
blob_service=BlobService(account_name='x', account_key='x', )
marker=None
while True:
containers = blob_service.list_containers(marker=marker)
for c in containers:
print c.name
if containers.next_marker:
marker = containers.next_marker
else:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment