How to access blobs and read excel files using pyhton in AzureFunction

Viewed 43

I would like to use python in azure function to read these excel files in this blob storage. i would like to know how to access this folder of blob in the easiest way and the python code to read the excel files.

enter image description here

1 Answers

The easiest way would be to use input bindings

in your function.json add bindings

{
      "name": "inputblob",
      "type": "blob",
      "dataType": "binary",
      "path": "blob/path/filename.csv",
      "connection": "MyStorageConnectionAppSetting",
      "direction": "in"
    },

Then function

import logging import azure.functions as func

# The input binding field inputblob can either be 'bytes' or 'str' depends
# on dataType in function.json, 'binary' or 'string'.
def main(queuemsg: func.QueueMessage, inputblob: bytes) -> bytes:
    logging.info(f'Python Queue trigger function processed {len(inputblob)} bytes')
    return inputblob
Related