azureazure-storageazure-data-lake-gen2azcopy

Azcopy empty folders


I need to sync data from a local server to an Azure Cloud v2 storage account. I’m using the command azcopy sync “source server” “storage container “ —-delete-destination=true but the issue I’m facing is that empty folders are not managed correctly. In particular:

E.g. Initial situation in source and destination is a MainFolder containing a file 1.txt

The final situation in the source is a RenamedFolder containing the 1.txt file

I expect everything replicated at the destination instead I find: The RenamedFolder containing the 1.txt file (this is ok), The NewFolder is empty (this is not ok)

Of course, from website, I can create and remove empty folders (v2 account) but I need to sync a lot of data so I cannot do it manually.

Any idea how to solve it? Isn’t this supported in v2 storage accounts?


Solution

  • I need a complete replication of the local folder in Azure storage. This means I need to see empty folders and not find empty folders if a folder is renamed locally.

    Even when I tried, I encountered the same issue in my environment, and it is still not creating empty directories or folders and not deleting empty directories:

    Output:

     azcopy sync "[Source]" "https://xxxx.blob.core.windows.net/test?sp=racwdlmeop&st=2024-01-22T06:48:30Z&se=2024-01-22T14:48:30Z&spr=https&sv=2022-11-02&sr=c&sig=xxxxx" --delete-destination=true
    INFO: Any empty folders will not be processed, because source and/or destination don't have full folder support
    
    Job xxxxxx494 has started
    Log file is located at: C:\Users\v-vsettu\.azcopy\a02fec56-3b5b-b746-5b4f-7fec4cdf6494.log
    
    100.0 %, 8 Done, 0 Failed, 0 Pending, 8 Total, 2-sec Throughput (Mb/s): 0
    
    Job xxxx Summary
    Files Scanned at Source: 8
    Files Scanned at Destination: 4
    Elapsed Time (Minutes): 0.1672
    Number of Copy Transfers for Files: 8
    Number of Copy Transfers for Folder Properties: 0
    Total Number Of Copy Transfers: 8
    Number of Copy Transfers Completed: 8
    Number of Copy Transfers Failed: 0
    Number of Deletions at Destination: 4
    Total Number of Bytes Transferred: 3282512
    Total Number of Bytes Enumerated: 3282512
    Final Job Status: Completed
    

    Portal: enter image description here

    Currently, this feature is not supported in AzCopy. You can raise a new feature request through the GitHub link.