Srinath
Srinath

Reputation: 112

Azure: Unable to copy Archive blobs from one storage account to another?

Whenever I try to copy Archive blobs to a different storage account and changing its tier in destination. I am getting the following error:

Copy source blob has been modified. ErrorCode: CannotVerifyCopySource

I have tried copying Hot/Cool blobs to Hot/Cool/Archive. I am facing the issue only while copying Archive to Hot/Cool/Archive. Also, there is no issue while copying within same storage account.

I am using Azure python SDK:

blob_url = source_block_blob_service.make_blob_url(copy_from_container, blob_name, sas_token = sas)

dest_blob_service.copy_blob(copy_to_container, blob_name, blob_url, requires_sync = True, standard_blob_tier = 'Hot')

Upvotes: 3

Views: 1855

Answers (2)

Gaurav Mantri
Gaurav Mantri

Reputation: 136394

The reason you're getting this error is because copying an archived blob is only supported in the same storage account and you're trying it across different storage account.

From the REST API documentation page:

Copying Archived Blob (version 2018-11-09 and newer)

An archived blob can be copied to a new blob within the same storage account. This will still leave the initially archived blob as is. When copying an archived blob as source the request must contain the header x-ms-access-tier indicating the tier of the destination blob. The data will be eventually copied to the destination blob.

Upvotes: 1

silent
silent

Reputation: 16208

While a blob is in the archive access tier, it's considered offline and can't be read or modified.

https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-rehydration

To read the blob, you either need to rehydrate it first. Or, as described in the link above, you can also use the CopyBlob operation. I am not sure if the python SDK copy_blob() operation uses that API behind the scenes - maybe not if it did not work that way for you.

Upvotes: 0

Related Questions