HTTP ERROR 500 when entering query in url - Azure Functions

Zaid Khan 1 Reputation point
2022-03-16T06:26:13.387+00:00

Creating azure functions using Visual Studio with C#. The function runs perfectly fine when using on localhost. I need to enter query string for Httprequest in order to get the output. But when published to azure functions, functions starts fine but when entered the query it gives myFunctton.azurewebsites.net is currently unable to handle this request. HTTP ERROR 500. Error log insights is showing This function was programmatically called via the host APIs.'. How do i fix this? function doesnt have any issue on local but gives error when published, and cant find any solutions to this.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2022-03-16T13:42:55.96+00:00

    @Zaid Khan Thanks for reaching out. In the scenario where you are observing 500 error the suggestion would be to review the application insights log of your function app to know the root cause of the issue. As @Bruno Lucas mentioned that there could be a scenario where there can some settings in your local.settings.json which might be missing from your function app causing this behavior.

    Other scenarios can be if you are using dependencies like library etc. and the dependency is not installed correctly on your function app resulting in 500 errors. In case if application insights logs didn't help then you can also review the diagnostic and solve problem blade on your function app to know the root cause.

    If the above doesn't help then please refer to my private comment and share your function app name so I can assist you further.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.