34

What I have:

  • VS2015U2
  • ASP.NET 5 MVC 6 website
  • Deployed to Azure Web App
  • The site works locally
  • When I deploy to Azure I get internal server error (500)
  • I'm unable to Attach a debugger since they messed up something with the latest versions (tried manually too https://azure.microsoft.com/en-us/blog/introduction-to-remote-debugging-on-azure-web-sites/)
  • I have app.UseDeveloperExceptionPage(); but I guess the site is failing during configuration so it doesn't display any other information.

So how to resolve this? I need to see the .net exception but I have no idea how to do that.

Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
f0rt
  • 1,801
  • 3
  • 17
  • 30

7 Answers7

22

Try adding Application Insights to the app. You should see errors on startup of your application.

I would also take a look at your startup code to see if you are writing to disk anywhere during configuration or app.start. This might be the case if you are using AAD in any capacity.

You can also hit up the KUDU console by targetting https://sitename.scm.azurewebsites.net . You will be able to navigate in the debugging console to see the RAW logs from IIS. That might shed some light into the situation. See KUDU for more info.

CtrlDot
  • 2,463
  • 14
  • 11
  • 1
    I've able to resolved by turning on "Remove additional files at destination". The first time it failed with message it can't delete some files. The publish attempt succeeded and the site was running as expected. I've turned on Application Insights but I get no data. No events at all. Is there something special that I need to do to make it work? – f0rt May 01 '16 at 17:19
  • If I remember correctly, you have to add a particular key to your application web.config file. – CtrlDot May 02 '16 at 00:57
  • 3
    +1 for KUDU. Man that service did everything I needed. Why does Microsoft make all its actually useful tools so hard to find? – Ross Brasseaux Jul 27 '20 at 21:28
12

I solved this problem like show below.HTTP 500 error interested about that is not allowed to access the server.Go to azure portal address and choose your database.Press"Set server firewall " and Allow Azure services and resources to access this server choose "Yes" save that page and refresh your service.Than you can see your data

user12904960
  • 121
  • 1
  • 2
8
  1. Use the KUDU console at https://sitename.scm.azurewebsites.net
  2. Go to web.config file and check if the process path is correct.
3

I used the Azure Log Stream to help figure out what was going on. As Karishma Tiwari - MSFT said, the issue ended up being my web.config file (which was built for .NET 3.5 and not 4.7)

Here's the tutorial to set up Log Streaming: https://blogs.msdn.microsoft.com/azureossds/2016/09/28/how-to-identifyreview-errors-on-php-applications-in-azure-web-apps-using-log-stream-service/

My particular app's solution was to update my Azure App Service to use .NET 3.5, in its Application Settings, like so:

enter image description here

thargenediad
  • 388
  • 1
  • 3
  • 10
1

I got this error even though I had enabled Application Logging (Filesystem), Detailed error messages and Failed request tracing in App Service logs

This page isn’t working

mysite.azurewebsites.net is currently unable to handle this request.

HTTP ERROR 500

enter image description here

enter image description here

However by navigating to Log stream and selecting Application Logs I could see a detailed error message:

enter image description here

Ogglas
  • 62,132
  • 37
  • 328
  • 418
  • 4
    we should always mention how users will go that specific to enable. In user should click on https://portal.azure.com/#home => click on your site => on the left menu under monitoring click on App service log to enable the logs. – Wajid khan Aug 06 '21 at 13:09
  • and how did this 500.0 error help you? – devmiles.com Sep 09 '22 at 09:32
1

For me it worked after I turned "Allow Azure services and resources to access this server " to Yes enter image description here

DURGESH KUMAR
  • 57
  • 1
  • 4
1

I know this question has already been answered but here is a recent view of the Azure Portal where I found a solution to this problem

enter image description here

Jean-François Beaulieu
  • 4,305
  • 22
  • 74
  • 107