【发布时间】:2020-12-06 11:26:29
【问题描述】:
我是 Azure 新手,不知道如何在 Intellij 项目配置中配置 Azure 运行。
此时我尝试调试我在 shell 中运行的第一个 http-trigger 函数(在 Python 中)并放置调试器点。
问题:执行的函数既不返回响应字符串也不在调试点停止
这是屏幕截图,您可能会看到localhost:7071 成功启动,但是当我尝试使用http://localhost:7071/api/first-http-trigger?name=sdaf 触发我的功能时
它没有响应:Hello, {name}. This HTTP triggered function executed successfully. 并且不会停止调试器
我还为 Intellij 创建了 azure 配置,但它根本没有运行
更新:
function.json
{
"scriptFile": "__init__.py",
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "$return"
}
]
}
我也成功解决了 localhost api 的问题 http://localhost:7071/api/first-http-trigger?name=sdaf。
问题是 func init 在根目录中启动 但是 func new 是在孩子一号完成的。所以配置不正确。
我从一开始就解决了它,并在一个目录中执行了所有命令(func init、func new、func start)
但还有一个问题:调试点不起作用,我无法在 Idea 配置中配置 azure start
【问题讨论】:
-
你能分享你的
function.json文件吗? -
@AntonKomyshan 添加了function.json
标签: azure intellij-idea configuration azure-functions azure-functions-core-tools