f0rt
f0rt

Reputation: 1931

How to resolve error 500 on Azure web app?

What I have:

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

Upvotes: 36

Views: 110586

Answers (7)

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

Upvotes: 2

DURGESH KUMAR
DURGESH KUMAR

Reputation: 67

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

Upvotes: 2

Ogglas
Ogglas

Reputation: 70184

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

Upvotes: 2

user12904960
user12904960

Reputation: 131

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

Upvotes: 13

thargenediad
thargenediad

Reputation: 395

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

Upvotes: 3

Karishma Tiwari - MSFT
Karishma Tiwari - MSFT

Reputation: 1555

  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.

Upvotes: 8

CtrlDot
CtrlDot

Reputation: 2513

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.

Upvotes: 25

Related Questions