Skip to content

Instantly share code, notes, and snippets.

@shashankm28
Last active July 27, 2020 21:36
Show Gist options
  • Save shashankm28/c96b8710fa2686b4c2ff116023913e03 to your computer and use it in GitHub Desktop.
Save shashankm28/c96b8710fa2686b4c2ff116023913e03 to your computer and use it in GitHub Desktop.
List Azure container blobs using Python
def container_content_list(connection_instance, blob_path):
try:
blob_name_list = []
source_blob_list = connection_instance.list_blobs(name_starts_with=blob_path)
print (source_blob_list)
for blob in source_blob_list:
blob_name = blob.name.rsplit('/',1)[1]
blob_name_list.append(blob_name)
print (blob_name)
create_csv(blob_name_list)
except Exception as ex:
print ("Error: " + str(ex))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment