Use independent injected services in durable activity function #2667
Unanswered
paulprivalgo
asked this question in
Q&A
Replies: 1 comment 5 replies
-
You can use dependency injection, see here: Use dependency injection in .NET Azure Functions And if you're using isolated mode, dependency injection is supported by default. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
I originally asked this on StackOverflow then came across here so I have asked here as well in the hope I can get some help with a major issue I have with Activity functions
I have a orchestrator function
This takes data which is split by client
I want to process data for each client using an activity function ProcessClientData
This is where I hit a big issue.
I need each activity function instance to have its own instance of DataProcessorService which is a transient service containing an efcore DbContext
This whole architecture wont work in its current form because it is never possible to run operations in parallel within a DbContext
I would be running activity functions in parallel so I will get concurrent issues
Ideally I would be able to inject IDataProcessorService into the activity function but annoyingly this is not supported
How can I get round this major issue?
Paul
Beta Was this translation helpful? Give feedback.
All reactions