def get_blob_content()

in web-backend/backendUtils/blob_functions.py [0:0]


def get_blob_content(container_name, blob_path):
    """
    Retrieve the content of a blob from Azure Blob Storage.
    
    Args:
        container_name (str): Name of the container
        blob_path (str): Path to the blob within the container
        
    Returns:
        bytes: The content of the blob
        
    Raises:
        Exception: If there's an error retrieving the blob content
    """
    try:
        blob_client = blob_service_client.get_blob_client(container=container_name, blob=blob_path)
        # Download the blob content
        blob_content = blob_client.download_blob().readall()
        return blob_content
    except Exception as e:
        logging.error(f"Error retrieving content from blob {blob_path} in container {container_name}: {str(e)}")
        raise