1
votes

I need to copy a blob from archive tier to the hot tear in another container. If I'm using StartCopy method I'm getting "This operation is not permitted on an archived blob" error. Here is my code:

CloudBlockBlob blobSource = (CloudBlockBlob)item; 
CloudBlockBlob blobTarget = ArchiveContainer.GetBlockBlobReference(blobSource.Name);
blobTarget.StartCopy(blobSource);

It should be possible to do based on this article, but I didn't find any code sample. Is it possible to do with Microsoft.Azure.Storage.Blob, or I have to use REST API for that?

I'm using Microsoft.Azure.Storage.Blob NuGet package v.11.1.7

1
Since there is an option to pass a rehydrate policy I assume it is possible. Have you tried investigating the additional parameters accepted by StartCopy?Crowcoder
@Crowcoder: Thank you! There are extra parameters for such task.Alex K

1 Answers

2
votes

As @Crowcoder suggested I checked parameters for StartCopy method and found that I need:

blobTarget.StartCopy(blobSource, StandardBlobTier.Hot, RehydratePriority.Standard);