Azure azcopy download

PraveenKumar 316 Reputation points
2024-11-22T08:20:50.4666667+00:00

I am trying to download backup files from azure storage to on-prim VM. I tried to execute below command on on-prim server and getting below error. Please suggest If any changes required to fix error.

Source (azure): sa02.blob.core.windows.net/dbbackups

Destination: On-prim VM (F:backuptest)

azcopy copy "https://sa02.blob.core.windows.net/dbbackups

?sp=r&st=2024-11-22T08:02:43Z&se=2024-11-22T16:02:43Z&spr=https&sv=2022-11-02&sr

=c&sig=xK%2F%2BQcZdq1RxEOJfRj5afbNh6p2PmXMhNUSFzls9LGU%3D" "F:\backuptest" --re

cursive=true

INFO: Scanning...

failed to perform copy command due to error: failed to initialize enumerator: ca

nnot use directory as source without --recursive or a trailing wildcard (/*)

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,302 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,976 questions
0 comments No comments
{count} votes

Accepted answer
  1. Deepanshukatara-6769 11,700 Reputation points
    2024-11-22T08:34:15.7266667+00:00

    Hello , Welcome to MS Q&A

    The issue seems with your AzCopy command is that it is not correctly formatted for copying a directory. Specifically, you need to ensure that the source URL ends with a trailing slash (/) or a wildcard (/*) to indicate that it is a directory. Here is the corrected command:

    azcopy copy "https://sa02.blob.core.windows.net/dbbackups/?sp=r&st=2024-11-22T08:02:43Z&se=2024-11-22T16:02:43Z&spr=https&sv=2022-11-02&sr=c&sig=xK%2F%2BQcZdq1RxEOJfRj5afbNh6p2PmXMhNUSFzls9LGU%3D" "F:\backuptest" --recursive=true
    
    
    

    Make sure there are no line breaks in the URL and that the URL ends with a trailing slash (/). This indicates to AzCopy that the source is a directory and should be copied recursively.

    Please try and let us know if faces issues again

    Kindly accept if it works

    Thanks

    Deepanshu


1 additional answer

Sort by: Most helpful
  1. Nehruji R 8,161 Reputation points Microsoft Vendor
    2024-11-22T10:15:48.92+00:00

    Hello PraveenKumar,

    Greetings! Welcome to Microsoft Q&A Platform.Adding to below answer. Please check the following to resolve the issue,

    If you're uploading or downloading data between a storage account and an on-premises hosting component, make sure that the hosting component that runs AzCopy can access either the source or destination storage account. You might have to use IP network rules in the firewall settings of either the source or destination accounts to allow access from the public IP address of the hosting component.

    As you're encountering an error because AzCopy requires either the --recursive flag or a trailing wildcard (/*) when specifying a directory as the source. If you receive an error message that states that your parameters aren't recognized, make sure that you're using the correct version of AzCopy. AzCopy v8 and earlier versions are deprecated. AzCopy v10 is the current version, and it's a complete rewrite that doesn't share any syntax with the previous versions. Refer to AzCopy Migration Guide for v8 to v10.

    Also, make sure to use built-in help messages by using the -h switch together with any command (for example, azcopy copy -h). See Get command help. To view the same information online, see azcopy copy.

    To help you understand commands, we provide an education tool that's located in the AzCopy command guide. This tool demonstrates the most popular AzCopy commands along with the most popular command flags. To find example commands, see Transfer data. If you have a question, try searching through existing GitHub issues first to see whether it was already answered.

    When you copy to an Azure File share, if you forgot to specify the --preserve-smb-permissions flag and you don't want to transfer the data again, consider using Robocopy to bring over the permissions.

    Hope this helps! please let us know if you have any further queries. I’m happy to assist you further.


    Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    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.