Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.92k stars 442 forks source link

Azure function can't read a static file occasionally #9861

Open catwang01 opened 7 months ago

catwang01 commented 7 months ago

I'm using a timer triggered azure function in .NET.

Azure function info:
runtime version: 4.29.1.21919
file system: windows

.NET version: .NET6.0

I have a static json file which is published to the azure function runtime environment. It is placed in the root of the project and I use the following code to get its path:

Path.Combine(context.ExecutionContext.FunctionAppDirectory, 'myconfig.json')

The weird thing is that the azure function occasionally throws FileNotFound error on this file. Sometimes the azure function can read the file and sometimes it can't, without any code or azure function configuration change.

Does anyone have any idea about why this happens?

well0549 commented 1 month ago

Have a look here, maybe it will help you...

https://github.com/Azure/azure-functions-durable-extension/issues/2823