python - Python v2 函数中的表存储绑定(bind)

标签 python azure-functions

我正在使用 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/

相关文章:

python - 在嵌入非常大的图像时,您能否减少 ReportLab 的内存消耗,或者是否有一个 Python PDF 工具包可以?

python - 从没有指导性 HTML 结构的具有挑战性的网站中抓取信息

python - 如果字符串中的单词与单独系列中的单词匹配,则替换它们

python - 如何从 Django 中的 url 中删除空格

postgresql - 使用 java 和 Postgres DB 绑定(bind)的 Azure 函数

azure - 在本地计算机上编译 Azure Functions(.csx 文件)

c# - 使用 Azure 函数从事件中心将数据插入 Sql Server

python - 在循环中创建变量然后赋值

azure - 如何使用 azure CLI 停止插槽中的函数应用

azure - 无法使用 VS Code 将 Azure Function Apps 发布到 Azure 服务环境