【发布时间】:2021-04-05 14:38:56
【问题描述】:
我一直在尝试部署具有 azure 功能的烧瓶应用程序。它不工作。 我是天蓝色的新手...
我的烧瓶应用程序是一个简单的计算器,我想在线使用 azure 函数。 我的文件目录如下:
flaskapp
|-flask application;
|-index.html
azure_function:HTTP trigger function
|-__init__.py
|-function.json
这是我的 init.py
def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse:
return func.WsgiMiddleware(application).handle(req, context)
当我尝试在 vs 代码中本地调试我的函数时,我无法使其工作:找不到 404。
当我执行函数时,我得到:执行函数“functionName”。回复:"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>404 Not Found</title> <h1>Not Found</h1> <p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p> "
有人可以帮帮我吗?
【问题讨论】:
-
很多信息丢失了。功能的触发器/绑定是什么?你如何“执行功能”?例如。在 Portal 上或在 CLI 或 Postman/curl 上的笔记本电脑上或...?您在哪里看到您提到的回复?在日志文件中,在 UI 上,在 CLI 上.. ?
-
我这边没问题。有日志吗?
-
在哪里可以找到日志@BowmanZhu?
-
转到
C:\Users\yourusernameonlocal\AppData\Local\Temp\LogFiles\Application\Functions\Function\yourfunctionname。 -
VSCode的终端应该会显示日志。
标签: python-3.x visual-studio-code azure-functions