Starts in:
0 DAY
8 HRS
56 MIN
46 SEC
Starts in:
0 D
8 H
56 M
46 S
Open Closed

DYNAMIC BLOB STORAGE OPTION #2805


User avatar
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)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    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.

    1. You can try to use different containers across your tenants.
    2. 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(...);
      
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06