Search code examples
azureazure-functionsazure-deployment

Unable to replicate MSFT example for 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 guess the correct link is here.

I was able to perform all the instructions from the GitHub page without any trouble and deployment was successful too. But towards the end I am unable to view the output in my browser. 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 which looked like

https://FunctionAppName.azurewebsites.net/%7B*route%7D

The GitHub webpage suggests that the deployed function URL would like

http://FunctionAppName.azurewebsites.net/hello/Foo

I tried the following links and still no success.

https://FunctionAppName.azurewebsites.net/sample

https://FunctionAppName.azurewebsites.net/%7B*route%7D/sample \

https://FunctionAppName.azurewebsites.net/%7B*route%7D/hello/JOHN

When I checked the logs for the function app, I only see Http 5xx code in the logs

image1

There is no successful triggers using the URL image2.

So I am unable to replicate the example from Microsoft.

Questions

  1. Is anyone else also having troubles using MSFT example for Azure functions?
  2. Or, Does any one know if is there any changes done recently w.r.t. Azure functions so this example will not work?

Solution

  • 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!