I haven't been able to find much documentation on the isolation of Azure functions in an app service plan.
If you share a static variable for example an HttpClient
between azure function invocations I presume reading through the scalability suggestions that it could run in the same process or separate processes or separate servers... which is fine, using Lazy<T>
can help with threading issues.
But could separate Azure Functions share a worker process? i.e. should I isolate static variables to ensure isolation of the functions? I gather using a ConcurrentDictionary
with a key for the function is a good approach to help solve this, but I haven't found any documentation that discusses isolation.
You can manage this by having one or many Function Apps:
Different functions of the same Function App will be running in the same process and will reuse any static state with other functions of the same app running on the same host.
Functions of different Function Apps are isolated from each other.
To see that visually you may go to Kudu (of each app). On Environment tab you see a machine name, so you may check that two apps are running on the same machine. Then, on Process Explorer tab you will see a w3wp.exe
process assigned to a specific Function App.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With