问题
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:
As @Crowcoder suggested I checked parameters for StartCopy method and found that I need:
blobTarget.StartCopy(blobSource, StandardBlobTier.Hot, RehydratePriority.Standard);
来源:https://stackoverflow.com/questions/62759750/copy-an-archived-blob-to-an-online-tier