0
votes

Lets suppose I have a FolderA on Azure blob storage and I want a new folder named FolderB with the same content as FolderA and on the same Azure blob container. Is there anyway I can do this programmatically or in an automated way rather than creating the folder and uploading all the content manually?

1
Are you trying to do this as a one-time shot or do you want this to continually sync FolderA to FolderB as changes happen over time?Bryan Lewis
always remember: blob storage does not know the concept of folders. The are "prefixes" that might be shown as a folder in different clients, but in the end its all part of a blob namesilent
As @silent posted, for a one-time sync, AzCopy is the way to go. Super simple. If you need to automate this to happen over time, then you probably need to look into Event Grid and monitoring your container for changes, triggering something like a Function to mimic those changes into the other folder.Bryan Lewis

1 Answers

1
votes

Using azcopy you can do this. This example is from here

Copy one blob virtual directory to another by using a SAS token:

azcopy cp "https://[srcaccount].blob.core.windows.net/[container]/[path/to/directory]?[SAS]" "https://[destaccount].blob.core.windows.net/[container]/[path/to/directory]?[SAS]" --recursive=true

Source and destination account can be the same