Python Azure HTTP Function Call Returning 500 When I Include Finance Package Function

Josiah Swanson 1 Reputation point
2022-06-26T06:28:40.737+00:00

Here's my main difficulty: even though the Finance Package works fine inside my Azure CronJob Function, when I try to make use of the same Package in an HTTP Function, I get an ambiguous 500 error response. It dawned on me that I need to either configure some sort of reverse proxy to accept responses or configure some gateway between outside websites and my function site. However, I'm not sure how to receive responses in the context of a Python Package function.
214988-screenshot-from-2022-06-25-23-38-03.png
If it matters, I am trying to utilize yFinance (import yfinance). Yet, this same problem has cropped up in other ways, so I don't think it's limited to this package. My Function app is setup with a Consumption Plan.
Thanks!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,679 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
851 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 27,111 Reputation points Microsoft Employee
    2022-06-29T00:25:12.633+00:00

    What you're doing is perfectly fine @Josiah Swanson . You can use req_body.getJson() to get the json representation of the payload and pull the property out that you want. As you can see below, I passed in

       {  
         "ticker": "MSFT"  
       }  
    

    and was able to log out ticker in both body and property form.

    215877-image.png