Troubleshooting HTTP Errors In Azure Websites By KUDU Console

KUDU console is an in-built site extension on Azure Websites. To access this add .scm to the URL as shown below:

http://yoursitename.scm.azurewebsites.net/ (Replace yoursitename with name of your site)

Access this link in Internet Explorer.

Hit ALT+V and select Toolbars and then Favorites bar.

bar

This will add a shortcut to the KUDU console in the favorites bar as shown below:

console

Unexpected error

  1. Launch Internet Explorer and browse your site http://<yoursitename>.azurewebsites.net/

  2. On the page click on Unexpected Error.

    error

  3. You will see the following error on the browser:

    error

  4. In IE, go to ToolsInternet Options.

  5. Click on Advanced tab and select “Show friendly HTTP error messages”,

    Advanced

  6. Hit CTRL+F5 and you will see the actual error message.

    error

  7. This indicates we are getting a 500 error.

Enable HTTP Logging for the site

  1. In Visual Studio, right click the site and select View Settings as earlier.

  2. Enable Web Server Logging as shown below:

    Logging

  3. Browse the page https://<yoursitename>.azurewebsites.net/Unexpected/Default.aspx
    (Replace <yoursitename> with name of your site).

  4. You will get the error message as seen earlier.

  5. Go to the KUDU Console for your site.

  6. Click on Debug Console and select CMD.

  7. You will see a explorer view of the directory structure for the site.

  8. Browse to Logfiles  http  RawLogs.

  9. You will see the http log file generated here. Click on the edit (pen icon) as shown below:

    edit

  10. You will find entries with HTTP status code set to 500.19.

    2015-03-06 12:53:40 AZCONF15 GET /Unexpected/Default.aspx X-ARR-LOG-ID=a5e3e912-ca76-451d-a538-d43c80fb3255 80 - 167.220.236.13 Mozilla/5.0+(Windows+NT+6.3;+WOW64;+Trident/7.0;+Touch;+rv:11.0)+like+Gecko ARRAffinity=54fc7ad43555a17449bdf1c1be0ab2483d56ea4a5f9e0c01049c06ebecf902d7 - azconf15.azurewebsites.net 500 19 13 453 968 78

Enabling Detailed Error logs to determine the problem

  1. In Visual Studio, right click the site and select View Settings as earlier.

  2. Enabled Detailed error logging as shown below:

    error

  3. Browse the page https://<yoursitename>.azurewebsites.net/Unexpected/Default.aspx
    (Replace <yoursitename> with name of your site).

  4. You will get the error message as seen earlier.
      
  5. Go to the KUDU Console for your site.

  6. Click on Debug Console and select CMD.

  7. You will see a explorer view of the directory structure for the site.

  8. Browse to Logfiles - DetailedErrors.

  9. Click on the download icon as shown below:

    download

  10. This will launch another IE instance where you can see the log indicating the reason behind the problem:

    error

Yellow Screen of Death

  1. Launch Internet Explorer and browse your site http://<yoursitename>.azurewebsites.net/

  2. On the home page, click on Yellow Screen of Death.

    page

  3. This will result in the error as shown below:

    error

  4. We will try to determine the reason behind this error without turning of custom errors via web.config.

  5. Go to the KUDU Console.

  6. Select Tools - Support,

    Support

    This will launch the Azure Websites Support portal.

  7. Click on Analyze and then click on Event Viewer.

    Event Viewer

    The Event Viewer is a site extension which mimics the view similar to the desktop version of Event Viewer.

  8. Here is the screenshot of the view:

    events

  9. Analyze the Details section (highlighted in red above) to determine what is causing the error message.

  10. Scroll down to the bottom of the Details section to know the reason behind the error. Below is a snippet of the section:

    Thread information:
    Thread ID: 16
    Thread account name: IIS APPPOOL\azconf15
    Is impersonating: False
    Stack trace:
    at SharedComponents.Utilities.GetData() in e:\ComProjects\AzConf2015\SharedComponents\Utilities.cs:line 33
    at MAWSHOL.YSOD.Page_Load(Object sender, EventArgs e)
    at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
    at System.Web.UI.Control.OnLoad(EventArgs e)
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)