title: Azure Function - localhost works but upstream fails with internal server error
body: <p>I have the following health check / status method in my Azure function app:  (v4)</p>
  <pre><code>public static class HealthStatus
  {
      [FunctionName(&quot;HealthStatus&quot;)]
      public static async Task&lt;IActionResult&gt; Run(
          [HttpTrigger(AuthorizationLevel.Function, &quot;get&quot;, &quot;post&quot;, Route = &quot;health/status&quot;)] HttpRequest req,
          ILogger log)
      {
          log.LogInformation(&quot;C# HTTP trigger function processed a request.&quot;);
  
          string qn = req.Query[&quot;qn&quot;];
  
          string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
          dynamic data = JsonConvert.DeserializeObject(requestBody);
          qn = qn ?? data?.name;
  
          string responseMessage = string.IsNullOrEmpty(qn )
              ? &quot;qn : All. Status OK&quot;
              : $&quot;qn : {qn }. Status OK&quot;;
  
          return new OkObjectResult(responseMessage);
      }
  }
  </code></pre>
  <p>Locally when I run a GET on this, i get the &quot;All.  Status OK&quot; method.
  Upstream, after I publish to azure, when i use the &quot;code &amp; test&quot; option in azure to try to run this function, it only works if I GET with a query string parameter called qn.  Otherwise, instead of a 200 OK, I get a &quot;500 internal server error&quot;.
  The logs show this error:</p>
  <pre><code> 2022-06-14T17:49:36.042 [Information] C# HTTP trigger function processed a request.
  2022-06-14T17:49:36.150 [Error] Executed 'HealthStatus' (Failed, Id=asdf-e859-asdf-asdf-asdf123123, Duration=78ms)'string' does not contain a definition for 'name'
  </code></pre>
  <p>Any tips as to why the results are different and how I can fix would be appreciated.</p>