【发布时间】:2022-11-04 15:58:24
【问题描述】:
当我尝试运行下面定义的 azure 函数时,我收到以下错误日志
The 'my_function' function is in error: The binding name my_function_timer is invalid. Please assign a valid name to the binding.
Azure Function 的有效绑定名称的格式是什么?
函数定义
我在my_function 目录中有两个文件:
-
__init__.py包含函数的python代码 -
function.json包含函数的配置
这是这两个文件的内容
__init__.py
import azure.functions as func
import logging
def main(my_function_timer: func.TimerRequest) -> None:
logging.info("My function starts")
print("hello world")
logging.info("My function stops")
function.json
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "my_function_timer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 0 1 * * *"
}
]
}
我使用Azure/functions-action@v1 github 操作部署此功能
【问题讨论】:
标签: python azure azure-functions