将存档的Blob复制到在线层 [英] Copy an archived blob to an online tier

查看:64
本文介绍了将存档的Blob复制到在线层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将blob从存档层复制到另一个容器中的热泪珠.如果我使用StartCopy方法,则会出现不允许对已归档Blob进行此操作" 错误.这是我的代码:

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);

应该有可能基于这篇文章,但是我没有找到任何代码示例.可以使用Microsoft.Azure.Storage.Blob,还是必须使用REST API?

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?

我正在使用Microsoft.Azure.Storage.Blob NuGet软件包v.11.1.7

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

推荐答案

按照@Crowcoder的建议,我检查了StartCopy方法的参数,发现我需要:

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

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

这篇关于将存档的Blob复制到在线层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆