- ABP Framework version: v8.1.0
- UI Type: Angular
- Database System: EF Core (SQL Server)
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
- Exception message and full stack trace:
- Steps to reproduce the issue: I am trying to configure the File Management module to get data from Azure Blob instead of Database. But after following all the steps based on your document, it is still using the database only.
16 Answer(s)
-
0
hi
. But after following all the steps based on your document, it is still using the database only.
Please share your configuration code.
-
0
Hi @maliming,
I have used below code for Azure configuration. I have tried by adding below code in Domain, Application & APIHost module.
Configure<AbpBlobStoringOptions>(options => { options.Containers.ConfigureDefault(c => { c.UseAzure(container => { container.ConnectionString = configuration["Azure:BlobConnectionString"]; container.ContainerName = configuration["Azure:BlobContainerName"]; container.CreateContainerIfNotExists = true; }); }) options.Containers.Configure<FileManagementContainer>(c => { //c.UseDatabase(); c.UseAzure(container => { container.ConnectionString = configuration["Azure:BlobConnectionString"]; container.ContainerName = configuration["Azure:BlobContainerName"]; container.CreateContainerIfNotExists = true; // Add other configurations as needed }); }); });
-
0
Your code seems no problem.
Can you share a simple project? liming.ma@volosoft.com
-
0
Sure, I will share the test project in sometime. Meanwhile can you please help me which is the right project to add the above configuration from these 3 Domain, Application & APIHost?
Thank you.
-
0
hi
You should add it to
ConfigureServices
method ofAPIHost
project -
0
Hi @maliming, I tried to creating a new clean project but getting some error in lepton theme, may be because of version. But you can try from your end.
I have followed below steps
- Created a new project
- Added File Management Module
- Added "Volo.Abp.BlobStoring.Azure" package in Api.Host project
- Added below code in ApiHostModule.cs file
private void ConfigureAzureBlob(IConfiguration configuration) { Configure<AbpBlobStoringOptions>(options => { options.Containers.ConfigureDefault(c => { c.UseAzure(container => { container.ConnectionString = configuration["Azure:BlobConnectionString"]; container.ContainerName = configuration["Azure:BlobContainerName"]; container.CreateContainerIfNotExists = true; }); }); options.Containers.Configure<FileManagementContainer>(c => { c.UseAzure(container => { container.ConnectionString = configuration["Azure:BlobConnectionString"]; container.ContainerName = configuration["Azure:BlobContainerName"]; container.CreateContainerIfNotExists = true; // Add other configurations as needed }); }); }); }
- Call above method from ConfigureServices method.
- Run the Api Project & Angular project
- When I open the File Management UI page. I am expecting the folders & files should come from my Azure container. Also When I create a new folder it should create the folder in Azure blob container. But it is adding the entry in FmDirectoryDescriptors table in the database.
Please help me what I am doing wrong.
Thank you.
-
0
hi
When I open the File Management UI page. I am expecting the folders & files should come from my Azure container.
This is by design. Only
file/blob
will be stored on Azure. Thefile and folder
info will be stored in the FM database. -
0
oh okay, so you mean, If I upload a file inside that folder it will go to azure, right?
-
0
Yes. Azure is used store file. The FM module is used to store file/folder info.
-
0
Ok thanks for clarification. It is uploading file in the azure. Can you please help me, if I can have any way to manage the organize data in azure?
Also, If I want to upload a file from coding, do we have any accessible method of file management module to create folder in file management module? So I can have track of all the documents uploaded from code in file management module.
Thank you so much for your help.
-
0
hi
if I can have any way to manage the organize data in azure?
This is not the initial design of the FM module.
If I want to upload a file from coding, do we have any accessible method of file management module to create folder in file management module? So I can have track of all the documents uploaded from code in file management module.
You can inject the Domain or AppService services to upload and manage the file/folder.
https://docs.abp.io/en/commercial/latest/modules/file-management#domain-services https://docs.abp.io/en/commercial/latest/modules/file-management#application-services
-
0
Hi @maliming, Thank you for your reply. I got how to manage the files & folder programmatically.
Can you please help me how to override the getall api of file management module? Like I just want to display files & folder of specific folder instead of all folders by default.
Or is there any way so I can use the UI of file management module and use my api to get list of files & folders?
Thank you.
-
0
hi
Can you please help me how to override the getall api of file management module
You can check this document to learn how to override the services in the module.
https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Guide
-
0
Thank you @maliming for your help. Can we use the file management component as a child component in other page?
-
0
Hi @maliming, I make it working. Thank you so much for all your help.
-
0
Good news!