title: GET requests are working, POST requests are not (Microsoft Azure South Central US)
body: <p>Not sure what is going on, but it looks as though POST requests for Azure Functions are not working. I've tested this with Postman and I'm getting a null response from a POST request to my function, but I'm getting the default response when I send a GET request.</p>
  
  <p>My resources are also located in the South Central US data center... I believe this is contributing... but just to make sure I'd like to know if anyone else is getting this error? Could there be something I'm doing wrong for GET to work and not POST?</p>
  
  <p>EDIT: It is returning code 500 internal server error. Here is the call stack from Application Insights: </p>
  
  <pre><code>Microsoft.Azure.WebJobs.Host.FunctionInvocationException:
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor+&lt;ExecuteWithLoggingAsync&gt;d__17.MoveNext (Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=nullMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.csMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: 293)
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter1.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor+&lt;TryExecuteAsync&gt;d__14.MoveNext (Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=nullMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.csMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: 89)
  Inner exception System.InvalidOperationException handled at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw:
     at Microsoft.Azure.WebJobs.Host.Executors.DelayedException.Throw (Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=nullMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\DelayedException.csMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: 27)
     at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor+&lt;ExecuteWithWatchersAsync&gt;d__24.MoveNext (Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=nullMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.csMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: 478)
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor+&lt;ExecuteWithLoggingAsync&gt;d__23.MoveNext (Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=nullMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.csMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: 444)
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor+&lt;ExecuteWithLoggingAsync&gt;d__17.MoveNext (Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=nullMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.csMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: 249)
  Inner exception Newtonsoft.Json.JsonSerializationException handled at Microsoft.Azure.WebJobs.Host.Executors.DelayedException.Throw:
     at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
     at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
     at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
     at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
     at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
     at Newtonsoft.Json.Linq.JToken.ToObject (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
     at Newtonsoft.Json.Linq.JToken.ToObject (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
     at Microsoft.Azure.WebJobs.Extensions.Http.HttpTriggerAttributeBindingProvider+HttpTriggerBinding.ConvertValueIfNecessary (Microsoft.Azure.WebJobs.Extensions.Http, Version=3.0.0.0, Culture=neutral, PublicKeyToken=nullMicrosoft.Azure.WebJobs.Extensions.Http, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: C:\azure-webjobs-sdk-extensions\src\WebJobs.Extensions.Http\HttpTriggerAttributeBindingProvider.csMicrosoft.Azure.WebJobs.Extensions.Http, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: 406)
     at Microsoft.Azure.WebJobs.Extensions.Http.HttpTriggerAttributeBindingProvider+HttpTriggerBinding.ApplyBindingData (Microsoft.Azure.WebJobs.Extensions.Http, Version=3.0.0.0, Culture=neutral, PublicKeyToken=nullMicrosoft.Azure.WebJobs.Extensions.Http, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: C:\azure-webjobs-sdk-extensions\src\WebJobs.Extensions.Http\HttpTriggerAttributeBindingProvider.csMicrosoft.Azure.WebJobs.Extensions.Http, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: 228)
     at Microsoft.Azure.WebJobs.Extensions.Http.HttpTriggerAttributeBindingProvider+HttpTriggerBinding+&lt;BindAsync&gt;d__10.MoveNext (Microsoft.Azure.WebJobs.Extensions.Http, Version=3.0.0.0, Culture=neutral, PublicKeyToken=nullMicrosoft.Azure.WebJobs.Extensions.Http, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: C:\azure-webjobs-sdk-extensions\src\WebJobs.Extensions.Http\HttpTriggerAttributeBindingProvider.csMicrosoft.Azure.WebJobs.Extensions.Http, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: 174)
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
     at Microsoft.Azure.WebJobs.Host.Triggers.TriggeredFunctionBinding1+&lt;BindCoreAsync&gt;d__8.MoveNext (Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=nullMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Triggers\TriggeredFunctionBinding.csMicrosoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null: 57)
  </code></pre>
  
  <p>And here is the function code:</p>
  
  <pre><code>using Alexa.NET.Request;
  using Alexa.NET.Response;
  using Alexa.NET.Request.Type;
  using System.Data.SqlClient;
  using Microsoft.Azure.WebJobs;
  using Microsoft.Azure.WebJobs.Extensions.Http;
  using Microsoft.AspNetCore.Mvc;
  using Microsoft.Azure.WebJobs.Host;
  using System.Data;
  using Alexa.NET;
  using System;
  
  
  namespace MyFunction
  {
  
      public static class MyFunction
      {
  
          static readonly string azureConnection = "---Connection String---";
          static SqlConnection connection;
          static string welcomeMessage = "Welcome.";
  
          [FunctionName("FuncCall")]
          public static SkillResponse Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)][FromBody]SkillRequest incomingRequest, TraceWriter log)
          {
  
  
              SkillResponse skillResponseForBuilder;
              PlainTextOutputSpeech outputSpeech = new PlainTextOutputSpeech();
  
              switch (incomingRequest.Request)
              {
                  case LaunchRequest launch:
  
                      outputSpeech.Text = welcomeMessage;
                      SkillResponse skillResponse = new SkillResponse();
                      skillResponse.Version = "1.0";
                      skillResponse.SessionAttributes = null;
                      skillResponse.Response = new ResponseBody();
                      skillResponse.Response.OutputSpeech = outputSpeech;
                      skillResponse.Response.ShouldEndSession = false;
                      return skillResponse;
  
  
                  case IntentRequest intent:
                      string intentName = intent.Intent.Name;
                      if (intentName.Equals("RollTheDice"))
                      {
                          return RollDiceHandler(incomingRequest);
                      }
                      else if (intentName.Equals("CheckIn")) 
                      {
                          return CheckInHandler(incomingRequest);
                      }
                      else
                      {
                          DataTable funcdt = new DataTable();
                          using (connection = new SqlConnection(azureConnection))
                          using (
                              SqlCommand cmd = new SqlCommand("SPCallFunction", connection)
                              {
                                  CommandType = CommandType.StoredProcedure
                              })
  
                          {
                              connection.Open();
                              cmd.Parameters.Add(new SqlParameter("@IntentKey", intentName));
                              SqlDataReader funcdr = cmd.ExecuteReader();
                              funcdt.Load(funcdr);
                              if (funcdt.Rows.Count != 0)
                              {
                                  outputSpeech.Text = funcdt.Rows[0]["IntentValue"].ToString();
                                  connection.Close();
                              }
                              else
                              {
                                  outputSpeech.Text = incomingRequest.GetRequestType().ToString();
                                  connection.Close();
                              }
  
                          }
                      }
  
                      skillResponseForBuilder = ResponseBuilder.Tell(outputSpeech);
                      return skillResponseForBuilder;
  
  
                  default:
                      outputSpeech.Text = "Error.";
                      skillResponseForBuilder = ResponseBuilder.Tell(outputSpeech.Text);
                      return skillResponseForBuilder;
              }
          }
  
          // Test dialog handler
          public static SkillResponse RollDiceHandler(SkillRequest req)
          {
              SkillResponse skillResponse = new SkillResponse();
              PlainTextOutputSpeech outputSpeech = new PlainTextOutputSpeech();
              var request = req.Request as IntentRequest;
              if (request.DialogState == DialogState.Started)
              {
                  return ResponseBuilder.DialogDelegate(req.Session, request.Intent);
              }
              else if (request.DialogState != DialogState.Completed)
              {
                  return ResponseBuilder.DialogDelegate(req.Session);
              }
              else
              {
                  skillResponse.Response = new ResponseBody();
                  skillResponse.Response.ShouldEndSession = false;
                  if (request.Intent.Slots["DiceType"].Value != null)
                  {
                      var numSides = request.Intent.Slots["DiceType"].Value;
                      var rollResults = new Random().Next(Math.Max(1, Convert.ToInt32(numSides) - 1)) + 1;
                      outputSpeech.Text = "I rolled a " + numSides + " sided die and got a " + rollResults;
                      skillResponse.Response.OutputSpeech = outputSpeech;
                      skillResponse.Response.ShouldEndSession = true;
                      skillResponse.Version = "1.0";
  
                  }
                  else
                  {
                      outputSpeech.Text = "Hello.";
                      skillResponse.Response.OutputSpeech = outputSpeech;
                      skillResponse.Version = "1.0";
                      if (request.Intent.Slots["DiceType"].Value != null)
                      {
                          var numSides = request.Intent.Slots["DiceType"].Value;
                          var rollResults = new Random().Next(Math.Max(1, Convert.ToInt32(numSides) - 1)) + 1;
                          outputSpeech.Text = "I rolled a " + numSides + " sided die and got a " + rollResults;
                          skillResponse.Response.OutputSpeech = outputSpeech;
                          skillResponse.Response.ShouldEndSession = true;
                          skillResponse.Version = "1.0";
                      }
  
                  }
                  return skillResponse;
              }
          }
  
  
          public static SkillResponse CheckInHandler(SkillRequest req)
          {
              SkillResponse skillResponse = new SkillResponse();
              PlainTextOutputSpeech outputSpeech = new PlainTextOutputSpeech();
              var request = req.Request as IntentRequest;
              if (request.DialogState == DialogState.Started)
              {
                  return ResponseBuilder.DialogDelegate(req.Session, request.Intent);
              }
              else if (request.DialogState != DialogState.Completed)
              {
                  return ResponseBuilder.DialogDelegate(req.Session);
              }
              else
              {
                  skillResponse.Response = new ResponseBody();
                  skillResponse.Response.ShouldEndSession = false;
                  if (request.Intent.Slots["TechnicianName"].Value != null &amp;&amp; request.Intent.Slots["TicketNumber"].Value != null)
                  {
                      var techName = request.Intent.Slots["TechnicianName"].Value;
                      var ticketNumber = request.Intent.Slots["TicketNumber"].Value;
                      if (request.Intent.Slots["TechnicianCompany"].Value != null)
                      {
                          var techCompany = request.Intent.Slots["TechnicianCompany"].Value;
  
                      }                    
  
                      outputSpeech.Text = "Thank you.";
  
                      skillResponse.Response.OutputSpeech = outputSpeech;
                      skillResponse.Response.ShouldEndSession = true;
                      skillResponse.Version = "1.0";
                  }
                  return skillResponse;
              }
          } 
      }   
  }
  </code></pre>
  
  <p>`</p>