I have Blob in that is placed inside Virtual Directory. For example :
Test/Simulation/Testing.txt
Is it possible to delete Testing.txt only via Azure CLI ?
I’ve tried to use az storage blob delete and az storage blob delete-batch commands but without success.
While trying to delete the blob with both commands from above the Virtual Directories Test/Simulation are also being deleted.
2
Answers
reference from Sumarigo
In Azure Blob Storage, you can’t store empty folders because folders are represented as virtual directories. These directories are created by including a forward slash (/) in the blob name.
If you need to keep empty directory, you need to enable hierarchical namespace to existing storage account.
You can follow this MS-Document to upgrade the existing
storage v2
toAzure data lake storage gen2
with some unsupported features.Portal:
When the migration is complete, a message similar will appear.
Now, you can be able to keep the empty folder in the storage account and also you can use the same command to delete the files only.
Portal: