I have two functions under a Azure function plan. Also included in there is a static class with a public static string. Can I use this static string as a means of transferring data from one function to the other?
The main concern I have is regarding instances. If each trigger creates a new copy of the static class and its string content then I believe this shouldn't be a problem. So does each trigger of the first function that calls the static class create a new copy for itself of it or is it shared among different simultaneous function clients?
Should I look for an alternative approach like Redis cache or something similar?
Azure function is serverless. If you are running under a consumption plan multiple function instance will start executing and when instance is idle, it will release instances.
Maintaining state outside function is best approach.
I used Redis for same and seen lot of performance improvement in my application. If you have frequent read/write Redis is best option and you have to pay a dedicated amount for Redis instance.
If function request is not very frequent or budge is constant, you can use "Azure Storage Table" as well. you don't need to pay a dedicated amount.