0
votes

I try to access a csv file form my azure unfction following https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-output?tabs=python.

Input file:

  1. storage account: stpartnerdata001
  2. Blob containers: data01
  3. Folder: imdb-extensive-dataset
  4. File: IMDb movies.csv

I created a DataConnectionSettings01 in the function app Application setting with the value Connection String from key1 from the stpartnerdata001 storage account.

"name": "inputblob",
"type": "blob",
"path": "data01/imdb-extensive-dataset/IMDb movies.csv",
"connection": "DataConnectionSettings01",
"direction": "in"

I tried to run the function to printing out the file name:

import logging
import azure.functions as func


def main(req: func.HttpRequest, inputblob: func.InputStream) -> func.HttpResponse:
    logging.info('Function called')
    logging.info('input name: %s', inputblob.name)
    return func.HttpResponse("This HTTP triggered function executed successfully.")

When exeuction the funciton I always receive input name: None. How can I access the csv file?

1

1 Answers

0
votes

Sorry, looks like for now this is not available. This is a known issue:Blob Input Binding doesn't receive the blob.

The description is the metadata of input blob binding(name, length etc) is not provide by the function host, the best way is to use the python storage SDK to implement it.

The blob input binding could only get the blob content.