Azure Blob, File Storage - Folder creation & conversion to Zip programmatically in C#

Abhilab Das 26 Reputation points
2022-12-09T11:59:38.073+00:00

My project is using:
Azure.Storage.Blob - V12.10.0
Current .Net Core version - V2.2

I am looking for an efficient way to do this for Bulk Download, if link to appropriate Documents can be provided to solve the below queries using C#

My project requires me to do the following things on Azure Cloud

  1. Create folder & sub folders (hierarchy of folders)
  2. Upload files in those folders
  3. Create ZIP of the parent folder and get link for download.

From what I could figure out is - we cannot create empty folders programmatically; we can give nested path and it'll create all the folders on its own along with a file.

I looked into many tutorials & forums but couldn't find the right one in C#.

Please help me resolve these issues on how to do it programmatically.
Thanks in advance.

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,420 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
0 comments No comments
{count} vote

Accepted answer
  1. Sumarigo-MSFT 47,466 Reputation points Microsoft Employee Moderator
    2022-12-12T06:49:32.13+00:00

    @Abhilab Das Firstly, Apologies for the delay response ! Welcome to Microsoft Q&A

    Azure Storage doesn't provide any built-in functionality to achieve all of this requirement by default. However each of your requirements needs various steps to be taken. See the action plan inline to your questions:

    Action plan :
    Create folder and its hierarchy the sample code is here:
    Upload files to these folders, see the sample code here.
    Create ZiP of the parent folder and get link for the download. ( Similar workaround is here, You need to customize it based on your ask )

    Please let us know if you have any further queries. I’m happy to assist you further.

    ----------

    Please do not forget to 269516-accept-answer.png and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.