I am trying to create a new folder inside of Azure http trigger folder, in order to receive some files from an API call and save them based on the name.
config_country_folder = context.function_directory+"/config/"+country.upper()
os.makedirs(config_country_folder, exist_ok=True)
logging.info('Config folder was added')
this part is inside the __init__.py
of the trigger, and it's working locally.
however, once deployed and tested, the following error of code 500 occurred:
Result: Failure Exception: OSError: [Errno 38] Function not implemented: '/home/site/wwwroot/HttpTrigger1/config' Stack: File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 452, in _handle__invocation_request call_result = await self._loop.run_in_executor( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 718, in _run_sync_func return ExtensionManager.get_sync_invocation_wrapper(context, File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/extension.py", line 215, in _raw_invocation_wrapper result = function(**args) File "/home/site/wwwroot/HttpTrigger1/init.py", line 33, in main os.makedirs(config_country_folder, exist_ok=True) File "/usr/local/lib/python3.9/os.py", line 215, in makedirs makedirs(head, exist_ok=exist_ok) File "/usr/local/lib/python3.9/os.py", line 225, in makedirs mkdir(name, mode)
The issue is over the makedirs, and I went through the web, which they advised on using the context of the function to create folders. however the error occurred.
Also I was checking this link on using tempfile library, but this is not what I need here.