简体   繁体   中英

Azure Blob Copy from presigned to presigned url

I'm trying to copy an azure blob from one account to another. I have a destination and a source url with their shared access key.

the request that i've done are:

PUT on  [url with and without sastoken]

Authorization: "SharedAccessSignature [sas token encoded and decoded]"
x-ms-copy-source: "[sourceUri with and without sastoken]"
x-ms-copy-source-authorization: "SharedAccessSignature [sas token encoded and decoded]"
x-ms-requires-sync: "true"
x-ms-date: [example: 2023-01-03T17:27:02Z]
x-ms-version: [taken from destination sastoken]

empty body

In the documentations is not specified the content of the authorization header i've found it on inte.net. i've tried with and without x-ms-copy-source-authorization header that is reported in the documentation for copy from url but not in copy documentation i'm sure that source url is valid why befor these request i put a file on this blob. destination url is retrieved from an external service and i have no resolution from my machine i can test only after deploy.

if you have any ideas, you are welcome!

If you have SAS URL for both source and destination blobs, then you would do a PUT operation using the destination blob SAS URL.

You don't need Authorization header as the destination blob URL already has the authorization information (in the SAS URL).

You would need to specify source blob SAS URL for x-ms-copy-source .

You need not specify x-ms-copy-source-authorization as the source blob URL already has the authorization information (in the SAS URL).

You need not specify x-ms-date and x-ms-version .

To summarize, your request should look something like:

PUT on  [destination blob SAS URL]

x-ms-copy-source: "[source blob SAS URL]"
x-ms-requires-sync: "true"
empty body

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM