@Vikrant I'm glad to see you were able to resolve your issue. Thanks for posting your solution so that others experiencing the same thing can easily reference this. Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer, they can only accept answers by others, I'll repost your solution in case you'd like to Accept the answer.
. Issue:
Your python based Azure Function App encounters the below error:
Error 'FunctionBuilder' object has no attribute 'HttpResponse'
. .
Resolution:
You have updated return function as below and that works fine.
return "Invalid JSON in request body."