-
Notifications
You must be signed in to change notification settings - Fork 469
Closed
Description
Hi,
We are using durable functions with dependency injection. In our Startup.cs
file, we register our dependencies as follows:
services.AddScoped<IMyService>(serviceProvider => new MyService(...))
In our activity function, we are using normal constructor injection to get IMyService
instances.
The problem is that even if we are using AddScoped
for registering the service, during the activity function run, each class that asks for the service, gets a different instance of IMyService
. This breaks our app logic, because IMyService
users won't see each other's changes.
As a workaround to the earlier Azure Functions runtime DI issues, we had the following pinning in place FUNCTIONS_EXTENSION_VERSION = 2.0.12673.0
. The pinned version is not supported anymore by Azure, so our function DI is now broken again.
MikeNicholls, roszell, seninjaan, Primal977, benrobot and 1 more