天蓝色烧瓶< handler>在< fastCGI>中找不到scriptProcessor.应用程序配置 [英] Azure flask <handler> scriptProcessor could not be found in <fastCGI> application configuration
问题描述
我正在尝试在Azure Web应用程序中部署Python Flask应用程序.我创建了Web应用程序(Flask)并发布了我的代码.发布后,我从网站上得到了错误提示.
I am trying to deploy Python Flask application in the Azure web app. I had create web app(Flask) and published my code. After publish, I am getting below error from the site.
由于内部服务器错误而无法显示该页面发生了.
The page cannot be displayed because an internal server error has occurred.
查看日志时,我会看到以下错误.
When check the Log, i could see the below error.
但是,这仅发生在我的订阅中(MSDN提供了免费订阅).但是在组织"订阅中工作正常.
But this was happening only in my subscription(free subscription got with MSDN). But working fine in the Organisation subscription.
推荐答案
< fastCGI>
设置必须位于 applicationHost.config
文件中(位于 system.webServer
部分).只是将其放入 web.config
中是行不通的(通过在本地IIS而非Azure上进行测试来确认).配置示例如下所示:
The <fastCGI>
settings must be in the applicationHost.config
file (in the system.webServer
section) of IIS. Just putting it into web.config
does not work (confirmed by testing it on a local IIS, not in Azure). An example configuration may look like this:
<fastCgi>
<application
fullPath="D:\home\Python27\python.exe"
arguments="D:\home\Python27\wfastcgi.py"
maxInstances="16"
idleTimeout="21600"
instanceMaxRequests="10000000"
signalBeforeTerminateSeconds="60"
xdt:Transform="InsertIfMissing"
xdt:Locator="Match(fullPath)">
<environmentVariables>
<environmentVariable name="PYTHONHOME" value="D:\home\Python27" />
</environmentVariables>
</application>
</fastCgi>
您可能要调整此配置.
这应该为本地IIS解决,您可以在其中编辑 applicationHost.config
.我不确定Azure,但也许可以在这里找到一些提示: https://github.com/Azure/azure-python-siteextensions/issues/2 .
This should solve it for a local IIS where you can edit applicationHost.config
. I'm not sure about Azure, but maybe you can find some hints here: https://github.com/Azure/azure-python-siteextensions/issues/2.
这篇关于天蓝色烧瓶< handler>在< fastCGI>中找不到scriptProcessor.应用程序配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!