我正在使用 Python 和 HTTP 触发器测试 V2 函数。我想为表存储添加绑定(bind),但在拼凑如何做到这一点时遇到困难。我不清楚我的“表”绑定(bind)类型是否正确,如果正确,为什么在执行时找不到该类型。
在我的 function.json 中,我添加了以下绑定(bind):
{
"name": "eventRecordTableBinding",
"type": "table",
"connection": "alertingtest",
"tableName": "alerttests",
"direction": "in"
}
在我的函数代码中,我有:
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()
但是,当我触发函数时,出现此错误:
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"
最佳答案
Functions 2.0 中的 Python 目前不支持表绑定(bind)。您可以在此处提交功能请求 - https://github.com/Azure/azure-functions-python-worker/issues
谢谢!
关于python - Python v2 函数中的表存储绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52839913/