0
shijo created
This is a query regarding the dynamic blob storage option in abp.io. As per the current documentation, I have to add the provider options in the module class. Our requirement is, per tenant the provider options may vary. Is it possible to dynamically configure the provider options?
1 Answer(s)
-
0
Hi @shijo ABP Framework doesn't provide a configuration for tenant-based blob provider resolution. There are a couple of ways to achieve tenant-based storage.
- You can try to use different containers across your tenants.
- You can manually resolve BlobProvider according to CurrentTenant via using
IServiceProvider
.var provider = serviceProvider.GetRequiredService<AzureBlobProvider>(); // Or with type var provider = (BlobProviderBase) serviceProvider.GetRequiredService(typeof(AzureBlobProvider)); // According to a rule: var provider = (BlobProviderBase) serviceProvider.GetRequiredService(providerMappingDictionary[CurrentTenant.Id]); //Dictionary returns type await provider.SaveAsync(...);