Copy an archived blob to an online tier

会有一股神秘感。 提交于 2021-01-28 09:21:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!