I did I got an error message that the data was invalid. I think it has something to do with the enconding of the func.InputStream bytes.
I solved it by using the BlobService Class and droped all the bindings.
import os
from azure.storage.blob import BlobServiceClient
import pandas as pd
from io import BytesIO
import logging
import azure.functions as func
def read_parquet_from_blob_to_pandas_df(connection_str, container, blob_path):
blob_service_client = BlobServiceClient.from_connection_string(connection_str)
blob_client = blob_service_client.get_blob_client(container = container, blob = blob_path)
stream_downloader = blob_client.download_blob()
stream = BytesIO()
stream_downloader.readinto(stream)
df = pd.read_parquet(stream, engine = 'pyarrow')
return df
def main(req: func.HttpRequest) -> func.HttpResponse:
connect_str = os.environ['<your_storage_connection_string']
container = '<your_container>'
blob_path = '<your_blob_path>'
df = read_parquet_from_blob_to_pandas_df(connect_str, container, blob_path)
logging.info(str(df.head()))
return func.HttpResponse(f"This approach works!")