@Divya Sahu Thanks for posting your query on Microsoft Q&A.
You can achieve this by listing all blobs in a container and downloading them one by one.
Try the following sample code in Python and modify as per your requirement as needed.
from azure.storage.blob import BlobServiceClient
import io
def download_blob_to_stream(blob_service_client: BlobServiceClient, container_name, blob_name):
blob_client = blob_service_client.get_blob_client(container=container_name, blob=blob_name)
# readinto() downloads the blob contents to a stream and returns the number of bytes read
stream = io.BytesIO()
num_bytes = blob_client.download_blob().readinto(stream)
print(f"Number of bytes: {num_bytes}")
connection_string = "<connection_string>"
blob_service_client = BlobServiceClient.from_connection_string(connection_string)
container_name = "<container_name>"
blobs = blob_service_client.get_container_client(container_name).list_blobs()
for blob in blobs:
download_blob_to_stream(blob_service_client, container_name, blob)
If you have any questions at all, please let me know in the "comments" and I would be happy to help you. Comment is the fastest way of notifying the experts.
Please don’t forget to Accept Answer and hit Yes for "was this answer helpful" wherever the information provided helps you. This can be beneficial to other community members for remediation for similar issues.