in connectors/blob.py [0:0]
def download_blob(self):
"""
Downloads the blob data from Azure Blob Storage.
Returns:
bytes: The content of the blob.
Raises:
Exception: If downloading the blob fails after retries.
"""
blob_client = self.blob_service_client.get_blob_client(container=self.container_name, blob=self.blob_name)
data = b""
try:
logging.debug(f"[blob][{self.blob_name}] Attempting to download blob.")
data = blob_client.download_blob().readall()
logging.info(f"[blob][{self.blob_name}] Blob downloaded successfully.")
except Exception as e:
error_message = f"Error when downloading blob: {e}"
logging.error(f"[blob][{self.blob_name}] Failed to download blob. Error: {e}")
raise Exception(error_message)
return data