Even though as it seems to have been fixed, no information has been provided regarding how to use AddScoped properly per function calls.
The original bug is here:
https://github.com/Azure/azure-webjobs-sdk/issues/1950
After a full month, we have received no answers, no commits, no documentation explaining how this works.
I am opening this bug as an actionable item for the team to respond properly.
Just a heads up: AddScoped is not fixed as far as I can tell. I still am getting my dependencies behaving like singletons.
I can confirm this issue is not fixed in v3.0.6 (of Webjobs.Extensions.Storage BlobTrigger)
Edit: this appears to be working when adding scoped dependencies manually, I am running into an issue with this code always returns the same instance of CustomUserManager
builder.Services
.AddIdentityCore<CustomUser>()
.AddEntityFrameworkStores<CustomUserDBContext>()
.AddUserManager<CustomUserManager>()
Edit 2: Registering like this respects scoping as expected
builder.Services
.AddIdentityCore<CustomUser>()
.AddEntityFrameworkStores<CustomUserDBContext>();
builder.Services.AddScoped(typeof(CustomUserManager));
Most helpful comment
Just a heads up: AddScoped is not fixed as far as I can tell. I still am getting my dependencies behaving like singletons.