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
import os, uuid | |
from azure.identity import DefaultAzureCredential | |
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient | |
connection_string = "CONNECTION_STRING" | |
service = BlobServiceClient.from_connection_string(connection_string) | |
try: | |
account_info = service.get_account_information() | |
print('Using Storage SKU: {}'.format(account_info['sku_name'])) | |
container_client = service.get_container_client("files") | |
try: | |
for blob in container_client.list_blobs(): | |
print("Found blob: ", blob.name) | |
except ResourceNotFoundError: | |
print("Container not found.") | |
except Exception as ex: | |
print('Exception:') | |
print(ex) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment