I am trying to list blobs in a Blob Container in Azure storage account. Here is my code:
blob_service_client = BlobServiceClient.from_connection_string(landing_Access_token)
container_client = blob_service_client.get_container_client(container_name)
blob_list = container_client.list_blobs(prefix='/crm365/internal/reference/')
for i in blob_list:
print(i.name)
I got the error : The requested URI does not represent any resource on the server when I did the for loop to get every name of blobs. Everthing befor the loop was OK.
I have passed the prefix in list_blobs, but It was still same I've checked the connection string and I was able to log in the Azure storage and upload blobs to in the container. Could someone kindly help with that?
You can use the code below to list the blobs with specified prefixes using Python.
In my environment, I have some files with the below structure.
Portal:
Output:
Reference:
azure.storage.blob.ContainerClient class | Microsoft Learn