Unable to replicate the Azure function example from MSFT website

Man 46 Reputation points
2022-07-19T12:53:51.03+00:00

Hello,

I am new to Azure Functions, I tried to replicate the example from the Microsoft webpage here. Under the SETUP section, the web directs to a github link but the link is broken and the correct GitHub link is here.

I was able to perform all the instructions in the GitHub page without any trouble and deployment was successful. But towards the end I am unable to view the output in my browser after deploying the Azure function. I deployed the Azure function using visual studio code and at the end of the deployment I even received a URL from the Azure function. The GitHub webpage instructs a URL like
http://<FunctionAppName>.azurewebsites.net/hello/Foo
to test the output, but when I deploy the URL looked like
https://<FunctionAppName>.azurewebsites.net/%7B*route%7D

I tried the following and still no success.
https://<FunctionAppName>.azurewebsites.net/sample
https://<FunctionAppName>.azurewebsites.net/%7Broute%7D/sample
https://<FunctionAppName>.azurewebsites.net/%7Broute%7D/hello/JOHN

When I checked the logs for the function app, I only see Http 5xx code in the logs as seen here 222351-image2.jpg . Count of Http 2xx and Http 4xx codes are zero as seen here 222335-image1.jpg.

No changes were made to the code from the GitHub URL. Can anyone help me to identify the reason for the error and fix it?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,033 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Man 46 Reputation points
    2022-07-20T18:17:59.347+00:00

    nest_asyncio package used in the Azure function code must be included in the requirement.txt file. After adding the same, the API is working fine with no other changes. This instruction is missing in the GitHub link!

    1 person found this answer helpful.