title: Web Api on Azure shows no error detail using 'return InternalServerError(ex)'
body: <p>My Web Api when run locally (in Release mode) will return any errors in this format:</p>
  
  <pre><code>{
      "Message": "An error has occurred.",
      "ExceptionMessage": "No text specified",
      "ExceptionType": "System.Exception",
      "StackTrace": null
  }
  </code></pre>
  
  <p>But after deployment/publish to an Azure VM, only this remains:</p>
  
  <pre><code>{
      "Message": "An error has occurred."
  }
  </code></pre>
  
  <p><i>API code:</i></p>
  
  <pre><code>try
  {
      var msg = ...
      new MessageService().SaveMessage(msg)); // &lt;-- does some checks; may throw.
      return Ok();
  }
  catch (Exception ex)
  {
      return InternalServerError(ex);
  }
  </code></pre>
  
  <p>I'd like it to be more detailed on Azure, like the local result.<br>
  Can this be achieved, and if so, how?<br>
  <br>
  I already (temporarily) removed <code>&lt;compilation xdt:Transform="RemoveAttributes(debug)" /&gt;</code> from the <code>&lt;system.web&gt;</code> part of Web.Release.config, and then re-deployed, but that made no difference.<br>
  <br>
  Or am I using the wrong approach/pattern?<br>
  Obviously technical details should be limited, but right now we get no details at all.</p>