locked
CURL Command to download a Azure Storage File Share RRS feed

  • Question

  • hi ,

    I want to download a file that is stored in Azure file storage , file share service. 

    On the target machine , i want to avoid installing azure cli 

    Can any one please help how to download the file with just the URL using CURL ? 

    I have a shared key for that file 

    Tuesday, April 28, 2020 5:56 AM

Answers

  • Hi Sashank,

    1) Generate a SAS URL to the account, share/file. You can use the portal, storage explorer, or the SDK. This can be done on a different machine. 

    2) Append &api-version=2019-07-07  to the URL, or a different version as desired to get the desired features.

    3) Use curl to download from the desired resource URL with the SAS token.

    Alternatively, download Azcopy or storage explorer. (You specified CLI, which isn't the only option.)

    I would actually recommend you use Azcopy for this scenario since you don't need to use CLI, There is a latest  version of this recently released, that will bring the file fidelity like ACLs, etc. I haven't tested it myself, but this should work just fine for your needs. 

    For more information, please refer to this article: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-files 


    Hope this helps! 

    Kindly let us know if the above helps or you need further assistance on this issue.
    ------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and Upvote on the post that helps you, this can be beneficial to other community members.

    Wednesday, April 29, 2020 4:15 AM

All replies

  • Hi Sashank,

    1) Generate a SAS URL to the account, share/file. You can use the portal, storage explorer, or the SDK. This can be done on a different machine. 

    2) Append &api-version=2019-07-07  to the URL, or a different version as desired to get the desired features.

    3) Use curl to download from the desired resource URL with the SAS token.

    Alternatively, download Azcopy or storage explorer. (You specified CLI, which isn't the only option.)

    I would actually recommend you use Azcopy for this scenario since you don't need to use CLI, There is a latest  version of this recently released, that will bring the file fidelity like ACLs, etc. I haven't tested it myself, but this should work just fine for your needs. 

    For more information, please refer to this article: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-files 


    Hope this helps! 

    Kindly let us know if the above helps or you need further assistance on this issue.
    ------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and Upvote on the post that helps you, this can be beneficial to other community members.

    Wednesday, April 29, 2020 4:15 AM
  • hi , Thanks for the reply , 

    here is what i did 

    1. Generated a SAS Token 

    2. Got the URL for the File to be downloaded 

    3. Appended the SAS Token to the URL in step 2 

    4. Copied the full URL in browser in cognito mode,  the file downloaded successfully 

    5. I tried the same full URL with CURL command in terminal , am getting error 

    [1] 8132
    [2] 8133
    [3] 8134
    [4] 8135
    [5] 8136
    [6] 8137
    [7] 8138
    [2]   Done                    ss=f
    [3]   Done                    srt=so
     <?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.

    Any help ? 

    Wednesday, April 29, 2020 9:37 AM