Last active
July 27, 2020 21:36
-
-
Save shashankm28/c96b8710fa2686b4c2ff116023913e03 to your computer and use it in GitHub Desktop.
List Azure container blobs using Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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