Advertisement
Guest User

Untitled

a guest
May 13th, 2016
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. import azure
  2. from azure.storage.blob import BlockBlobService
  3. #from azure.storage.blob import BlobService
  4. #from azure.storage import *
  5.  
  6.  
  7. blob_service = BlobService(account_name='<CONTAINER>', account_key='<ACCOUNT_KEY>')
  8.  
  9.  
  10. blobs = []
  11. marker = None
  12. container = '<CONTAINER>'
  13.  
  14. while True:
  15.     batch = blob_service.list_blobs(container, marker=marker)
  16.     blobs.extend(batch)
  17.     if not batch.next_marker:
  18.         break
  19.     marker = batch.next_marker
  20. for blob in blobs:
  21.     print(blob.name)
  22.  
  23. result = blob_service.list_blobs(container)
  24. for b in result.items:
  25.     r = blob_service.get_blob_to_path(container, b.name, "folder/{}".format(b.name))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement