Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure - customErrors="off" in web.config is not displaying detailed errors in Azure app (cloud service)

I have an app deployed to Azure and it uses ADFS (Active Directory Federated Services) for authentication.

When the user tries to navigate to the app on Azure, it redirects the user to the ADFS authentication page. User enters their credentials and clicks OK, and ADFS redirects the user to the landing page of my app.

Everything is working fine up to this point. I'm getting a generic server error on the app once the user hits the landing page. PROBLEM: I need to see the detailed errors. I try setting <customErrors="off" />, repackage my app and redeploy, but that doesn't give me detailed errors:

enter image description here

Here's what I've tried: I've tried packaging my app in Debug mode (after Release mode didn't work), I've edited both web.config's (in the root of the solution, as well as in the Views folder, just to cover all bases). Nothing worked.

What am I doing wrong?

like image 290
Mike Marks Avatar asked Jul 10 '13 21:07

Mike Marks


People also ask

How do I check Azure App Service errors?

Log detailed errors To save the error page or failed request tracing for Windows apps in the Azure portal, navigate to your app and select App Service logs. Under Detailed Error Logging or Failed Request Tracing, select On, then select Save. Both types of logs are stored in the App Service file system.

How do I edit web config in Azure App Service?

If you want to change web. config files you can use the Azure portal, there is a tool called "App Service Editor" in preview or Kudu that lets you edit any of the files you've deployed.

How do I disable custom errors in web config?

This type of unexpected error may occurs on local or remote server. In asp.net, we can find the exact error message by setting mode="Off" with in customErrors tag in web. config of our application.

How do I troubleshoot Azure App Service?

To access App Service diagnostics, navigate to your App Service web app or App Service Environment in the Azure portal. In the left navigation, click on Diagnose and solve problems.


2 Answers

A couple of things to try:

  1. Are you SURE the customerErrors attribute is set correctly? The Identity and Access tooling in Visual Studio seems to like to reset that back to "Off" (every time you update via the tool).
  2. Are you able to connect to the role instance via Remote Desktop? If so, you could inspect the web.config settings for the site? Browsing to the site from the server might also provide a more friendly error message.
  3. When you RDP into the cloud service, you can look at the Event Viewer to see the detailed error messages.
like image 98
mcollier Avatar answered Oct 17 '22 20:10

mcollier


I fixed this error by ftp'ing into my azure website and deleting the wwwroot folder and then publishing my website via visual studio.

like image 21
Daniel Kerridge Avatar answered Oct 17 '22 21:10

Daniel Kerridge