Azure Website – The page cannot be displayed because an internal server error has occurred

Tonight I had some problems with an old .NET 2.0 site that I wanted to move from my old host to Azure Website. I did not want to change anything on the site, I just wanted it to run on Azure.

So I created a Azure Website for it and uploaded all the files via FTP – no problems of cause. I then hit the site and got some pretty useless windows errors:

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

As a .NET developer I of cause tried to set CustomErrors=”Off” in Web.config, as the first thing, but that did not change anything.

I googled it with Bing (Scott Hanselman joke), and found that I was not the only one who found this error message useless, so I found a solution.

I enabled diagnostics in Azure Portal on the Website under the Configuration tab, scroll to the bottom. And set both application and site diagnostics on and to Verbose, see screen below.
It is important to turn on the Detailed Errors Messages.

Screen Shot 2014-12-28 at 23.33.20

 

After enabling some diagnostics, save and restart the website, just to be sure.

I then hit the website sometimes and went into the SCM for the site.

https://YOURSITENAME.scm.azurewebsites.net/

I do not think there is a link to this inside the Azure Portal currently (december 2014), so you just browse to your site and put in this little .scm.

In here you can do a lot of things, but what you want to do here is: Tools -> Diagnostics Dump.

This will give you a .zip file. Browse to LogFiles->DetailedErrors and here you should see some error pages.

I looked into some of these and could see the same error on all of them. Basically it said:

“An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.”

In my case, I did not want to change anything on the actually site, I just needed it to run. So I went into the Configuration tab and changed from Integrated Mode to Classic – Bum! – site was running on Azure!

Hope this helps somebody out there.