Blob folder creation

Nandan Hegde 36,151 Reputation points MVP Volunteer Moderator
2022-11-17T12:40:54.237+00:00

By any chance is it possible to create a folder in blob with name :

UK/Test.

Note>> this should be 1 folder itself with the above name and should not create 2 folder with Test being the sub folder.
My guess is nope, but wanted to confirmation that there are no escape characters etc to create it

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,201 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alistair Ross 7,466 Reputation points Microsoft Employee
    2022-11-17T13:54:48.563+00:00

    Hi @Nandan Hegde

    You can find all the details relating to blob naming and virtual hierarchies here https://learn.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata.

    To answer your question, if you are using a slash "/" it will simulate a folder hierarchy. For example:

    You have 2 blobs called

    • "folderA/folderB/file1.txt"
    • "folderA/folderB/file1.txt"

    within the storage account it would simulate the folder hierarchy like

    folderA  
     |_folderB  
       |_file1.txt  
       |_file2.txt  
    

    whereas in reality the blobs are as below:

      folderA/folderB/file1.txt  
      folderA/folderB/file2.txt  
    

    If you created a third blob called " folderC/folderD/file3.txt" and then deleted file3.txt, it would delete folderC and folderD because they don't actually exist, they are just part of the blob name.

    I hope this helps provide you with the information you need. If it does, please make sure to mark the question as answered so it helps other people in future.

    Kind regards

    Alistair

    0 comments No comments

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.