Matthew
Matthew

Reputation: 694

Table Storage Binding in Python v2 Function

I'm testing a V2 function using Python and an HTTP trigger. I would like to add a binding for table storage, but am having trouble piecing together how to do so. It is unclear to me whether my binding type of 'table' is correct, and if so, why that type is not found on execution.

In my function.json, I added the following binding:

{
     "name": "eventRecordTableBinding",
     "type": "table", 
     "connection": "alertingtest",
     "tableName": "alerttests",
     "direction": "in"
}

And in my function code, I have:

def main(req: func.HttpRequest, eventRecordTableBinding) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')

inputTable = open(os.environ.get('eventRecordTableBinding'), 'r').read()

However, when I trigger my function, I get this error:

System.Private.CoreLib: Exception while executing function: Functions.alert_verifier. System.Private.CoreLib: Result: Failure
Exception: FunctionLoadError: cannot load the alert_verifier function: unknown type for eventRecordTableBinding binding: "table"

Upvotes: 2

Views: 535

Answers (1)

Asavari Tayal
Asavari Tayal

Reputation: 46

Table bindings are currently unsupported for Python in Functions 2.0. You can file the feature request here - https://github.com/Azure/azure-functions-python-worker/issues

Thanks!

Upvotes: 2

Related Questions