I'm experiencing some weird issues with Azure Functions that I can't find too much information on.
I am creating a function that makes an API call, but more importantly reads/writes to a json file. You are able to view this in the updateJson()
function.
My Function App deploys successfully and I'm able to view it on Azure. The majority of the time I receive the beneath errors:
1. Failed to fetch the file content
2. Azure Functions Runtime is unreachable
3. Adding third party dependencies in the Azure portal is currently not supported for Linux Consumption Function Apps
Beneath are the imports I'm using along with my requirements.txt
file.
Imports:
Requirements.txt:
Function 503:
I'm making use of the beneath to locate the dir for the json file I'm reading/writing from/to:
script_dir = os.path.dirname(__file__)
with open(os.path.join(script_dir, 'team.json')) as f:
I'm overall very confused with what is happening. Has anyone experienced anything similar? I've included logging.info
statements within my script to see where the failure occurs. I'm not sure whether this is the issue or if its got to do with my imports. I've made use of requests
and other imports in other Python Azure Functions and they've worked just fine.
Any help is greatly appreciated; please ask if you require further information.