title: Node Js RestFull API on Azure,Returns HTTP Error 500.1001 - Internal Server Error
body: <p>I have deployed my nodeJs RESTFull API with MySQL, on azure using Dropbox.
  On console i have seen logs that application started listing and database is connected. thus lines are from my code which i have logged using console.log();
  When I request for my API/Resource, I get 500 ERROR massage from server. I searched a lot to solve this issue but am not able to solve this one.</p>
  
  <p>I have added app setting with web.config sharing snapshot
  <a href="https://i.stack.imgur.com/swawK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/swawK.png" alt="App settings"></a>  </p>
  
  <p>i am using web.config sample from git hub <a href="https://github.com/projectkudu/kudu/wiki/Using-a-custom-web.config-for-Node-apps" rel="nofollow noreferrer">web.config</a></p>
  
  <p>and my general settings look like this 
  <a href="https://i.stack.imgur.com/ytadD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ytadD.png" alt="enter image description here"></a></p>
  
  <p>and the last thing logs from azure</p>
  
  <pre><code>   &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; 
      &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; 
  
      &lt;head&gt; 
      &lt;title&gt;IIS Detailed Error - 500.1001 - Internal Server Error&lt;/title&gt; 
      &lt;style type="text/css"&gt; 
      &lt;!-- 
      body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;} 
      code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;} 
      .config_source code{font-size:.8em;color:#000000;} 
      pre{margin:0;font-size:1.4em;word-wrap:break-word;} 
      ul,ol{margin:10px 0 10px 5px;} 
      ul.first,ol.first{margin-top:5px;} 
      fieldset{padding:0 15px 10px 15px;word-break:break-all;} 
      .summary-container fieldset{padding-bottom:5px;margin-top:4px;} 
      legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;} 
      legend{color:#333333;;margin:4px 0 8px -12px;_margin-top:0px; 
      font-weight:bold;font-size:1em;} 
      a:link,a:visited{color:#007EFF;font-weight:bold;} 
      a:hover{text-decoration:none;} 
      h1{font-size:2.4em;margin:0;color:#FFF;} 
      h2{font-size:1.7em;margin:0;color:#CC0000;} 
      h3{font-size:1.4em;margin:10px 0 0 0;color:#CC0000;} 
      h4{font-size:1.2em;margin:10px 0 5px 0; 
      }#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS",Verdana,sans-serif; 
      color:#FFF;background-color:#5C87B2; 
      }#content{margin:0 0 0 2%;position:relative;} 
      .summary-container,.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;} 
      .content-container p{margin:0 0 10px 0; 
      }#details-left{width:35%;float:left;margin-right:2%; 
      }#details-right{width:63%;float:left;overflow:hidden; 
      }#server_version{width:96%;_height:1px;min-height:1px;margin:0 0 5px 0;padding:11px 2% 8px 2%;color:#FFFFFF; 
      background-color:#5A7FA5;border-bottom:1px solid #C1CFDD;border-top:1px solid #4A6C8E;font-weight:normal; 
      font-size:1em;color:#FFF;text-align:right; 
      }#server_version p{margin:5px 0;} 
      table{margin:4px 0 4px 0;width:100%;border:none;} 
      td,th{vertical-align:top;padding:3px 0;text-align:left;font-weight:normal;border:none;} 
      th{width:30%;text-align:right;padding-right:2%;font-weight:bold;} 
      thead th{background-color:#ebebeb;width:25%; 
      }#details-right th{width:20%;} 
      table tr.alt td,table tr.alt th{} 
      .highlight-code{color:#CC0000;font-weight:bold;font-style:italic;} 
      .clear{clear:both;} 
      .preferred{padding:0 5px 2px 5px;font-weight:normal;background:#006633;color:#FFF;font-size:.8em;} 
      --&gt; 
      &lt;/style&gt; 
  
      &lt;/head&gt; 
      &lt;body&gt; 
      &lt;div id="content"&gt; 
      &lt;div class="content-container"&gt; 
      &lt;h3&gt;HTTP Error 500.1001 - Internal Server Error&lt;/h3&gt; 
      &lt;h4&gt;The page cannot be displayed because an internal server error has occurred.&lt;/h4&gt; 
      &lt;/div&gt; 
      &lt;div class="content-container"&gt; 
      &lt;fieldset&gt;&lt;h4&gt;Most likely causes:&lt;/h4&gt; 
      &lt;ul&gt;    &lt;li&gt;IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.&lt;/li&gt;    &lt;li&gt;IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.&lt;/li&gt;    &lt;li&gt;IIS was not able to process configuration for the Web site or application.&lt;/li&gt;     &lt;li&gt;The authenticated user does not have permission to use this DLL.&lt;/li&gt;   &lt;li&gt;The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.&lt;/li&gt; &lt;/ul&gt; 
      &lt;/fieldset&gt; 
      &lt;/div&gt; 
      &lt;div class="content-container"&gt; 
      &lt;fieldset&gt;&lt;h4&gt;Things you can try:&lt;/h4&gt; 
      &lt;ul&gt;    &lt;li&gt;Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.&lt;/li&gt;     &lt;li&gt;Check the event logs to see if any additional information was logged.&lt;/li&gt;  &lt;li&gt;Verify the permissions for the DLL.&lt;/li&gt;    &lt;li&gt;Install the .NET Extensibility feature if the request is mapped to a managed handler.&lt;/li&gt;  &lt;li&gt;Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click &lt;a href="http://go.microsoft.com/fwlink/?LinkID=66439"&gt;here&lt;/a&gt;. &lt;/li&gt; &lt;/ul&gt; 
      &lt;/fieldset&gt; 
      &lt;/div&gt; 
  
      &lt;div class="content-container"&gt; 
      &lt;fieldset&gt;&lt;h4&gt;Detailed Error Information:&lt;/h4&gt; 
      &lt;div id="details-left"&gt; 
      &lt;table border="0" cellpadding="0" cellspacing="0"&gt; 
      &lt;tr class="alt"&gt;&lt;th&gt;Module&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;iisnode&lt;/td&gt;&lt;/tr&gt; 
      &lt;tr&gt;&lt;th&gt;Notification&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ExecuteRequestHandler&lt;/td&gt;&lt;/tr&gt; 
      &lt;tr class="alt"&gt;&lt;th&gt;Handler&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;iisnode&lt;/td&gt;&lt;/tr&gt; 
      &lt;tr&gt;&lt;th&gt;Error Code&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;0x00000002&lt;/td&gt;&lt;/tr&gt; 
  
      &lt;/table&gt; 
      &lt;/div&gt; 
      &lt;div id="details-right"&gt; 
      &lt;table border="0" cellpadding="0" cellspacing="0"&gt; 
      &lt;tr class="alt"&gt;&lt;th&gt;Requested URL&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;http://API:80/app.js&lt;/td&gt;&lt;/tr&gt; 
      &lt;tr&gt;&lt;th&gt;Physical Path&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;D:\home\site\wwwroot\app.js&lt;/td&gt;&lt;/tr&gt; 
      &lt;tr class="alt"&gt;&lt;th&gt;Logon Method&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Anonymous&lt;/td&gt;&lt;/tr&gt; 
      &lt;tr&gt;&lt;th&gt;Logon User&lt;/th&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Anonymous&lt;/td&gt;&lt;/tr&gt; 
  
      &lt;/table&gt; 
      &lt;div class="clear"&gt;&lt;/div&gt; 
      &lt;/div&gt; 
      &lt;/fieldset&gt; 
      &lt;/div&gt; 
  
      &lt;div class="content-container"&gt; 
      &lt;fieldset&gt;&lt;h4&gt;More Information:&lt;/h4&gt; 
      This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error. 
      &lt;p&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;amp;IIS70Error=500,1001,0x00000002,9200"&gt;View more information &amp;raquo;&lt;/a&gt;&lt;/p&gt; 
      &lt;p&gt;Microsoft Knowledge Base Articles:&lt;/p&gt; 
  
  
      &lt;/fieldset&gt; 
      &lt;/div&gt; 
      &lt;/div&gt; 
      &lt;/body&gt; 
      &lt;/html&gt; 
  </code></pre>