I have a function app hosted in Azure using linux consumption plan.I have written my code in python, so I can't host it on a windows platform.I want to write my logs into a separate file in a folder of a specific container.
This is my specific code block.
today = date.today()
logging.basicConfig(filename='https://invoicecompare.blob.core.windows.net/cont-invoicecompare/{}_logs.log'.format(today),
filemode='a',
format='%(asctime)s,%(msecs)d %(name)s %(message)s',
datefmt='%H:%M:%S',
level=logging.INFO,
force=True)
And this is the error I'm getting.
Result: Failure Exception: FileNotFoundError: [Errno 2] No such file or directory: '/home/site/wwwroot/https:/invoicecompare.blob.core.windows.net/cont-aacinvoicecompare/2023-04-10_logs.log' Stack: File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 357, in _handle__function_load_request func = loader.load_function( File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 44, in call return func(*args, **kwargs) File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/loader.py", line 132, in load_function mod = importlib.import_module(fullmodname) File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "/home/site/wwwroot/BlobTrigger/init.py", line 17, in logging.basicConfig(filename='https://invoicecompare.blob.core.windows.net/cont-aacinvoicecompare/{}_logs.log'.format(today), File "/usr/local/lib/python3.9/logging/init.py", line 2003, in basicConfig h = FileHandler(filename, mode, File "/usr/local/lib/python3.9/logging/init.py", line 1146, in init StreamHandler.init(self, self._open()) File "/usr/local/lib/python3.9/logging/init.py", line 1175, in _open return open(self.baseFilename, self.mode, encoding=self.encoding,
I tried saving the log file into /temp folder.Then it gave no error.But I want to save the log file permanently. And I can't view the /temp folder or /home/site/wwwroot/ folder because under the development tab, the advanced tools tab can't be seen. see here
Here I found that Advanced Tools (Kudu) is currently not supported for Linux Consumption plans.
Can anyone please give me a solution for this?
My purpose: Save the logs into a file and access it later.





