Range Header for Azure Put Block API

Naresh Goty 20 Reputation points
2023-09-01T04:04:55.72+00:00

Hi,

We are using Azure Put Block API to copy files from different cloud storage solutions. For the cloud storage, the Range header is required to download partial content. But Azure Put Block API from URL only mentioned about this header x-ms-source-range.

How does it work for the common cloud storage solutions to download partial content into azure blob using the put block API?

https://learn.microsoft.com/en-us/rest/api/storageservices/put-block-from-url?tabs=azure-ad&source=docs

Thanks

Naresh

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,529 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sumarigo-MSFT 47,466 Reputation points Microsoft Employee Moderator
    2023-09-04T04:27:51.6+00:00

    @Naresh Goty Firstly, Apologies for the delay response her!

    The x-ms-source-range is an optional parameter. If it is not specified the entire source blob contents are uploaded as a single block.

    The x-ms-copy-source:name is a required field and it specifies the URL of the source blob. So the source should be another storage account. Could you please check and confirm if your blob source is another Azure storage account ? or is that a third party cloud storage ? Please confirm if that supports / allows a copy operation to azure storage ?

    Note that the Azure Storage Client Library automatically handles setting the appropriate range headers. So instead of using the REST API check if you can leverage the azcopy instead. Please check if your scenario is listed here:

    More info: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&bc=%2Fazure%2Fstorage%2Fblobs%2Fbreadcrumb%2Ftoc.json#transfer-data

    Please let us know if you have any further queries. I’m happy to assist you further.


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


  2. Tuan Phan 0 Reputation points
    2023-11-16T17:33:36.0366667+00:00

    Hi @Sumarigo-MSFT ,

    I'd like to follow up this question. I'm having the same issue when our tool uses this "PUT Block From URL" API. Our source blob is Dropbox. Our tool does specify the x-ms-source-range so that it can split the entire blob into multiple blocks. For files size of a few GB it's working fine, but for files > 10GB, we got the similar error as above.

    {Status Code: 429, Reason Phrase: Too Many Requests, Response Body: <?xml version="1.0" encoding="utf-8"?><Error><Code>CannotVerifyCopySource</Code><Message>Too Many Requests_RequestId:61bb3b79-801e-005d-7818-1819c0000000_Time:2023-11-15T23:10:01.6417952Z</Message></Error>}
    

    Is this the limitation from this PUT Block API to support large files specifically sourced from Dropbox? And is there any workaround for that?


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.