Azure应用程序服务可以在嵌套文件夹中查找烧瓶应用程序。即使有枪支
我有一个烧瓶应用程序,我可以在本地运行,问题是当我尝试用Azure运行它时,似乎无法找到该应用程序。我的文件树看起来像下面的一样,Azure从 /聊天机器人文件夹中开始。我需要进入 /chatbot_application /chatbot以访问app.py,
Chatbot
├─── .vs
├───Chatbot_Application
│ └───Chatbot
│ ├───chatbot_backend
| ├───app.py
| ├─gunicorn.conf.py
如果我运行这样的azure应用程序,我将没有代码输出,如果我将启动配置调整为此,
gunicorn --bind=0.0.0.0 --chdir /Chatbot_Application.Chatbot app:app
我会收到错误。聊天机器人”“无论我提出哪种格式。 我正在考虑走wsgi.py路线,但我认为我不会有任何运气,因为它将无法导入app.py模块。
I have a flask app which I'm able to run locally no problem, the issue is when I try to run it in Azure, it seems the app.py can't be found since I'm deploying with GitHub. My file tree looks something like below, and Azure starts in the /Chatbot folder. I need to get into /Chatbot_Application/Chatbot to access app.py
Chatbot
├─── .vs
├───Chatbot_Application
│ └───Chatbot
│ ├───chatbot_backend
| ├───app.py
| ├─gunicorn.conf.py
If I run the Azure app like this I get no code output, IF I adjust the start up configuration to this
gunicorn --bind=0.0.0.0 --chdir /Chatbot_Application.Chatbot app:app
I get an error "can't chdir to 'Chatbot_Application.Chatbot'" no matter what format I put.
I'm thinking of going the wsgi.py route but I don't think I'll get any luck because it won't be able to import the app.py modules.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,该解决方案是为启动命令使用此格式。
这将有助于Azure识别app.py,请记住我的应用程序中的模块称为应用程序,因此这就是为什么它的应用程序:应用程序。您必须解决问题“找不到模块”
So, the solution was using this format for the startup command.
This will help Azure recognize the app.py, keep in mind the module within my app.py is called app so that's why it's app:app. You'll have to solve the issue 'cannot find module' ????