• Register
0 votes
1.2k views

Problem :

I am trying to deploy my Python Flask application in my Azure web app. I had created web app(Flask) and published the code. After publishing it, I am facing below error from the site.

The page cannot be displayed because an internal server error has occurred.

When I checked the Log, I could see the above error.

But this was the case only in my subscription(my free subscription with MSDN). But it was working fine in the Organisation subscription.

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I have gone through your question and I understood it.

I had faced the similar issue in the past and so know the solution on it.

The <fastCGI> settings must be done in your applicationHost.config file (in your system.webServer section) of IIS. Just putting it into your web.config does not work (I can confirm it by testing it on a local IIS). An example of the configuration may look like as below :

<fastCgi>
  <application
    fullPath="C:\home\Python27\python.exe"
    arguments="C:\home\Python27\wfastcgi.py"
    maxInstances="16"
    idleTimeout="21600"
    instanceMaxRequests="10000000"
    signalBeforeTerminateSeconds="60"
    xdt:Transform="InsertIfMissing"
    xdt:Locator="Match(fullPath)">
    <environmentVariables>
      <environmentVariable name="PYTHONHOME" value="C:\home\Python27" />
    </environmentVariables>
  </application>
</fastCgi>

You must adjust your configuration according to above configuration.

This should help you in solving it for a local IIS where you can edit the applicationHost.config.

Further Readings :

You can find more hints below: 

https://github.com/Azure/azure-python-siteextensions/issues/2.

9 7 4
38,600 points

Related questions

0 votes
1 answer 2 views
2 views
Problem: I installed the latest version of Python (3.6.4 64-bit) and the latest version of PyCharm (2017.3.3 64-bit). Then I installed some modules in PyCharm (Numpy, Pandas, etc), but when I tried installing Tensorflow it didn't install, and I ... some of the things which were suggested to other people, but nothing worked (this included installing Flask). How can I install Tensorflow? Thanks.
asked Apr 25 sumaiya simi 43.9k points
0 votes
1 answer 12 views
12 views
Problem: Please help me to solve it. the installer could not install the software because there was no software found to install
asked Mar 23 Ifra 34.7k points
0 votes
1 answer 3 views
3 views
Problem: I am running OS X 10.9.4 on my laptop, with Chrome 40.0.2214.94 and Selenium 2.44.0, which I installed for Python 2.7 with easy_install. My code is this basic code from a selenium walkthrough: from selenium import webdriver from selenium.webdriver.common. ... or location changes, as I am not the most well versed in computing! Thanks everyone, and I hope my question isn't too simple!
asked Apr 23 munim01 21k points
0 votes
1 answer 20 views
20 views
Problem: I need someone&rsquo;s help to fix it... an example of an attribute of an object might be
asked Mar 31 Ifra 34.7k points
0 votes
1 answer 26 views
26 views
Problem: I am facing following error: post data should be bytes, an iterable of bytes, or a file object. it cannot be of type str.
asked Mar 14 Wafa Abu Yousef 6.1k points
0 votes
1 answer 1.9K views
1.9K views
Problem : I am trying to convert my working Python 2.7 code into Python 3 code but I am facing following error post data should be bytes, an iterable of bytes, or a file object. it cannot be of type str.
asked Nov 16, 2019 peterlaw 6.9k points
0 votes
1 answer 9 views
9 views
Problem: I was trying a simple piece of code, get someone's name and age and let him/her know when they turn 21... not considering negatives and all that, just random. I keep getting this 'int' object is not subscriptable error. Error: 'int' object is not subscriptable
asked Mar 31 ummesalma 29.2k points
0 votes
1 answer 62 views
62 views
Problem : Getting bellow python and django error , any help: 'virtualenv' is not recognized as an internal or external command, operable program or batch file.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 193 views
193 views
Problem: typeerror: '_io.textiowrapper' object is not subscriptable.
asked Feb 19 Dan phillip 4.8k points
1 vote
2 answers 5.8K views
5.8K views
Problem : Getting bellow python and django error 'virtualenv' is not recognized as an internal or external command, operable program or batch file.
asked Nov 8, 2019 peterlaw 6.9k points