azureazure-blob-storageazcopy

How to download a directory from a storage account from the command line using the 'abfss://' uri


ADLS / Azure Blobstore provides URI's in the form like

abfss://feed-pipeline-workspace@smy-storage-account.dfs.core.windows.net/my-user/my-parquet.parquet

Is there no tool available that can simply take that URI and download? The az cli requires decomposing the path into various parts and in the end does not work due to various bugs. I have also tried azcopy copy and run into a different set of problems. It is not clear how to decompose the abfss URI into a path that is functional for azcopy.


Solution

  • It is not clear how to decompose the abfss URI into a path that is functional for azcopy.

    You can use the below command to download the parquet file from azure-data lake gen2 to the local folder.

    Command:

    azcopy copy "https://venkat098.dfs.core.windows.net/filesystem1/test/samplepar.parquet?<SAS-token>" "C:\\Users\\Downloads\\folder1" --recursive=true
    

    Here,

    You can get the SAS-token from your storage account through the portal.

    Portal ->Your storage account -> Shared access signature -> check the container and object -> Click GenerateSAS.

    enter image description here

    Output:

    azcopy copy "https://venkat098.dfs.core.windows.net/filesystem1/test/samplepar.parquet?<SAS-token>" "C:\\Users\\Downloads\\folder1" --recursive=true
    
    INFO: Scanning...
    INFO: azcopy.exe: A newer version 10.18.1 is available to download
    
    INFO: Any empty folders will be processed, because source and destination both support folders
    
    Job 1e8dffa1-b6e3-5e4e-7a07-5axxxxxx has started
    Log file is located at: C:\Users\.azcopy\1e8dffa1-b6e3-5e4e-7a07-5a7d866f0c35.log
    
    100.0 %, 1 Done, 0 Failed, 0 Pending, 0 Skipped, 1 Total,
    
    
    Job 1e8dffa1-b6e3-5e4e-7a07-5xxxxxx summary
    Elapsed Time (Minutes): 0.0669
    Number of File Transfers: 1
    Number of Folder Property Transfers: 0
    Total Number of Transfers: 1
    Number of Transfers Completed: 1
    Number of Transfers Failed: 0
    Number of Transfers Skipped: 0
    TotalBytesTransferred: 113629
    Final Job Status: Completed
    

    enter image description here

    Downloaded file: enter image description here