ASP.NET Core file system provider -- query container root

File System Providers in Blazor FileManager Component | Syncfusion


Is it possible to query the root blob directory using this provider? I'm not sure what values to supply for blobPath and filePath


1 Reply

SS Sivakumar ShunmugaSundaram Syncfusion Team September 13, 2022 11:10 AM UTC

Hi Mark,


Greetings from Syncfusion support.


We understand that you want to implement the Blazor FileManager component with the Azure file service provider. We have prepared a simple sample of Blazor FileManager with an Azure file service provider. We have attached the prepared sample for your reference.


To use the Azure service provider, you need to register the Azure storage by passing details like name, password, and blob name to the Register Azure method in the FileManager controller.


[AzureProviderController.cs]

 

        public AzureProviderController(IHostingEnvironment hostingEnvironment)

        {

            this.operation = new AzureFileProvider();

            blobPath = "<--blobPath-->";

            filePath = "<--filePath-->";

            blobPath = (blobPath.Substring(blobPath.Length - 1) != "/") ? blobPath + "/" : blobPath.TrimEnd(new[] { '/', '\\' }) + "/";

            filePath = (filePath.Substring(filePath.Length - 1) == "/") ? filePath.TrimEnd(new[] { '/', '\\' }) : filePath;

            this.operation.SetBlobContainer(blobPath, filePath);

            this.operation.RegisterAzure("<--accountName-->", "<--accountKey-->", "<--blobName-->");

        }


Also, we would like to let you know that blobPath is a container path in Azure blob storage, and filePath is the Files location path. For example, we have created a files container in the mentioned Azure blob storage. Inside that container, we have created a new folder Files which includes all files and folders that need to be viewed in the FileManager. Please refer to the below path for example.


Example path:

[AzureProviderController.cs]

 

        public AzureProviderController(IHostingEnvironment hostingEnvironment)

        {

            this.operation = new AzureFileProvider();

            blobPath = https://azure_service_account.blob.core.windows.net/files/;

            filePath = https://azure_service_account.blob.core.windows.net/files/Files;


Also, we have attached the Azure service provider GitHub location for your reference.


GitHub location: https://github.com/SyncfusionExamples/azure-aspcore-file-provider


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/AZUREF_1-16048932121070675247.zip


Please check the attached sample and get back to us if you need any further assistance.


Regards,

Sivakumar S


Loader.
Up arrow icon