List all azure containers in Python

Standard
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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.