Check the docs before asking a question: https://abp.io/docs/latest Check the samples to see the basic tasks: https://abp.io/docs/latest/samples The exact solution to your question may have been answered before, and please first use the search on the homepage.
Provide us with the following info: 🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration button.
Template: app Created ABP Studio Version: 0.9.25 Current ABP Studio Version: 1.0.1 ABP Suite: 9.2.0 ABP framework: 9.2.1 Tiered: Yes Multi-Tenancy: Yes UI Framework: blazor-server Theme: leptonx Theme Style: system Run Install Libs: Yes Database Provider: ef Database Management System: sqlserver Separate Tenant Schema: Yes Create Initial Migration: Yes Run Db Migrator: Yes Mobile Framework: maui Public Website: Yes Include Tests: Yes Kubernetes Configuration: No Distributed Event Bus: rabbitmq Use Local References: No Optional Modules: GDPR FileManagement TextTemplateManagement LanguageManagement AuditLogging Chat OpenIddictAdmin Selected Languages: English, English (United Kingdom), 简体中文, Español, العربية, हिन्दी, Português (Brasil), Français, Русский, Deutsch (Deuthschland), Türkçe, Italiano, Čeština, Magyar, Română (România), Svenska, Suomi, Slovenčina, Íslenska, 繁體中文
Default Language: English
Create Command: abp new NewApp -t app --tiered --ui-framework blazor-server --mobile maui --database-provider ef --database-management-system sqlserver --theme leptonx --separate-tenant-schema --public-website --without-cms-kit --dont-run-bundling -chat -file-management
Hello!
I am trying to implement the integration of the original File components and implementation generated by Abp Suite with my implementation of Azure Blob Storage and im facing some difficulties in the process.
As abp already implements with the File property type of abp suite, the file is been saved on a container pointing to the local database with its FileDescriptor within the function UploadFileAsync():
I've followed the documentation present in: https://abp.io/docs/latest/framework/infrastructure/blob-storing https://abp.io/docs/latest/framework/infrastructure/blob-storing/azure
However, the documentation does not clearly outline the best approach to replace the default local storage mechanism with Azure Blob Storage, especially while maintaining compatibility with the components generated by ABP Suite.
I would appreciate guidance on the recommended way to redirect file uploads to Azure Blob Storage instead of the local container, while ensuring that metadata and file descriptors continue to be handled correctly by the framework.
Thanks.
8 Answer(s)
-
0
To redirect file uploads from the default local (database) storage to Azure Blob Storage in an ABP Suite-generated application, while maintaining compatibility with the file components and metadata handling, follow these steps:
- Add Azure Blob Storage Module Dependency Ensure your module (typically the application or web module) depends on the Azure Blob Storage provider:
[DependsOn( typeof(AbpBlobStoringAzureModule) )] public class YourAppNameApplicationModule : AbpModule { }- Configure Azure Blob Storage as the Provider
In your module's
ConfigureServicesmethod, configure the default blob container to use Azure:
Configure<AbpBlobStoringOptions>(options => { options.Containers.ConfigureDefault(container => { container.UseAzure(azure => { azure.ConnectionString = "Your_Azure_Connection_String"; azure.ContainerName = "your-container-name"; azure.CreateContainerIfNotExists = true; }); }); });- Place this configuration in the module where your file upload logic resides (commonly the
.Applicationor.Webproject).
No Changes Needed in ABP Suite-Generated File Components The ABP Suite-generated file upload logic (as shown in your screenshot) uses
IBlobContainer. By configuring the default provider as above, all calls to_blobContainer.SaveAsync(...)will automatically use Azure Blob Storage instead of the local database.File Metadata and Descriptors The file metadata (such as
FileDescriptor) will continue to be stored in your database as before. Only the binary content will be redirected to Azure Blob Storage. The framework will handle the association between the metadata and the actual file content.Migration Note
- If you have existing files in the database and want to migrate them to Azure, you will need to implement a migration process to move the blobs and update references as needed.
Testing
- After configuration, upload a file using your existing ABP Suite-generated UI/component. The file should now be stored in Azure Blob Storage, and metadata will remain in your database.
This approach ensures seamless integration with ABP Suite-generated file components and maintains all metadata and descriptor handling.
Sources:
- https://abp.io/docs/latest/framework/infrastructure/blob-storing
- https://abp.io/docs/latest/framework/infrastructure/blob-storing/azure
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
I've successfully implemented the configuration for Azure Blob Storage as described in the official documentation. However, my question is more focused on the architectural design required to make this integration scalable and efficient across all modules of my solution.
Specifically, I'm looking to understand:
- What is the recommended architecture to fully integrate Azure Blob Storage with the file handling components generated by ABP Suite?
- Where in the code generated by ABP Suite (especially in Razor Pages and related file components) should I replace or extend the default logic to redirect file uploads from local database storage to Azure Blob Storage?
- Is it advisable to create a centralized service or abstraction layer to manage blob operations across modules? If so, what would be the best practice for implementing this in a modular and maintainable way?
The documentation provides a good starting point for configuring blob storage, but it doesn't clearly outline how to adapt the ABP Suite-generated file logic to use Azure Blob Storage as the primary storage backend.
I would greatly appreciate any guidance or examples that clarify the best approach to achieve this integration in a clean and scalable manner.
Thank you!
-
0
[chrisalves] said: I've successfully implemented the configuration for Azure Blob Storage as described in the official documentation. However, my question is more focused on the architectural design required to make this integration scalable and efficient across all modules of my solution.
Specifically, I'm looking to understand:
- What is the recommended architecture to fully integrate Azure Blob Storage with the file handling components generated by ABP Suite?
- Where in the code generated by ABP Suite (especially in Razor Pages and related file components) should I replace or extend the default logic to redirect file uploads from local database storage to Azure Blob Storage?
- Is it advisable to create a centralized service or abstraction layer to manage blob operations across modules? If so, what would be the best practice for implementing this in a modular and maintainable way?
The documentation provides a good starting point for configuring blob storage, but it doesn't clearly outline how to adapt the ABP Suite-generated file logic to use Azure Blob Storage as the primary storage backend.
I would greatly appreciate any guidance or examples that clarify the best approach to achieve this integration in a clean and scalable manner.
Thank you!
Hello, I would like to clarify some points:
When you use the file type for a property, ABP Suite uses the Blob Storing Infrastructure of the ABP Framework, which is fully provider-independent. You can easily configure any provider you want. By default, ABP templates are configured to use the database provider. If you switch to another provider, the file content will be stored directly in the relevant provider's storage. This means that when you configure Azure, your file content (BLOB) will be stored in Azure.
In addition to these structures, ABP Suite actually only stores some metadata about the files (such as file name and content type) on the database side, whether you use a file provider, database provider, or any other provider. On the UI side, we need to know the file’s content type and have a reference to the related file type via the
AppFileDescriptorentity.This is a design choice: when you have a property named
CoverImage, it will appear in the code asCoverImageId(of typeGuid) and will reference the corresponding record in theAppFileDescriptorstable in the database.Thus, the storage and implementation remain provider-agnostic on the blob storage side. However, it is still necessary to store basic information about the uploaded files in the database. (You can think of this system as a similar implementation to our File Management module.)
Regards.
-
0
Hi Engincan,
Thank you for your response.
Let’s keep this ticket open for a few more days while I review the point and run some test scenarios based on your suggestions.
Best regards,
-
0
[chrisalves] said: Hi Engincan,
Thank you for your response.
Let’s keep this ticket open for a few more days while I review the point and run some test scenarios based on your suggestions.
Best regards,
Sure 👍
-
0
Hi Engincan,
Thank you for your last advice and explanation.
Considering I’m developing a multi-tenant modular monolith application using ABP.io (Blazor Server + EF Core) having the entities and initial CRUD created by ABP Suite, organized into three modules and several entities. My project needs to manage file uploads for multiple entities across these modules, supporting multiple tenants.
From my research and reviewing ABP.io’s default implementation as you mentioned in this support Ticket, I’ve noticed that when a File property is added to an entity, the framework generates a separate file container for each entity, defaulting to the database provider. For my application, this results in many containers and duplicated file management logic within each entity’s AppService.
Instead, I’d like to use Azure BlobStore as the provider, centralizing all file uploads for all tenants into a single container. My plan is to organize files using subdirectories in the following structure: Tenant/Module/Entity/Property This would ensure tenant isolation, logical organization, and easier management—while also keeping things DRY and maintainable.
As I believe the Architeture proposed by ABP represents a good choice to follow, I would appreciate your advice on these points:
1) Recommended Approach in ABP Framework: What is the best practice in ABP to use a single Azure Blob Storage container for all file properties, with subdirectory separation by tenant, module, entity, and property?
2) Centralized Configuration: How can I centralize the file container configuration so that all file uploads (across tenants, modules, and entities) are consistent, easy to maintain, and avoid duplication?
3) Overriding ABP Suite’s Scaffolding: Is there a supported way to override or customize ABP Suite’s default file management scaffolding to generate this centralized logic? If not, what’s the best way to approach it?
4) Manual Implementation and Best Practices: If this structure needs to be implemented manually, what is the recommended way to organize the code/services to keep things DRY, robust, and extensible for future needs?
The documentation is unprecise on these points—especially regarding on centralization of Azure BlobStore configuration and multi modules scenarios. Any code samples, design suggestions, or documentation references would be greatly appreciated.
Thank you very much for your help!
-
0
Hi Chris, thank you for your detailed explanation and for clarifying the scenario. I don't have much experience with Azure Blob Storage but I'll try to clarify some points for you.
1. Recommended Approach in ABP Framework
As far as I know, you should be able to implement tenant/module/entity level separation by customizing the container naming convention. By default,
IAzureBlobNameCalculatoris used to calculate the full BLOB name, so you can create a service that implements this interface and apply your own logic. You can check theDefaultAzureBlobNameCalculator(https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.BlobStoring.Azure/Volo/Abp/BlobStoring/Azure/DefaultAzureBlobNameCalculator.cs) service for the current implementation. (Currently, the naming is something like:tenants/<tenant-id>)2) Centralized Configuration
For the configuration, you can refer to our documentation: https://abp.io/docs/latest/framework/infrastructure/blob-storing/azure#configuration (when it's being configured for default, it applies to all)
3) Overriding ABP Suite’s Scaffolding
Currently, you can search for File text in the ABP Suite's templates and update the .txt files. Unfortunately, this is the only option you have for now, or you need to update the code later the code generation manually.
4) Manual Implementation and Best Practices
If you are considering creating your own file-manager services, I recommend using the
IBlobContainerservice to make it provider-agnostic, so you can change the provider afterward if it's needed.On the other hand, it depends on how you structure your solution and services. I'm not sure that I have a suggestion at that point.
Btw, it is worth reiterating that, once the Azure Blob Provider is configured, the system is expected to behave as follows:
When a file is uploaded, a new record containing the file’s metadata is inserted into the
*FileDescriptorstable in the database, while the file content is stored in Azure Blob Storage. Subsequently, when the file is needed, theIBlobContainerservice retrieves it from Azure and returns it to the requesting component. -
0
Hi Engincan,
Thank you for your response.
Let’s keep this ticket open for a few more days while I review the point and run some test scenarios based on your suggestions.
Best regards,

