在WASB ListBlob中使用通配符 [英] Use wildcards in WASB ListBlobs

查看:105
本文介绍了在WASB ListBlob中使用通配符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure .Net SDK列出Windows Azure存储Blob容器中的所有blob.

I'm using Azure .Net SDK to list all blobs from Windows Azure Storage Blob container.

let client = account.CreateCloudBlobClient()
let container = client.GetContainerReference("my-container")
let list = container.ListBlobs("data/2014-*-17/", false) // ! here

如您所见,我正在尝试使用通配符前缀过滤blob.

as you can see i'm trying to filter blobs by wildcarded prefix.

UPD 自2019年7月起不受支持

UPD Not supported as 07/2019

推荐答案

不幸的是,这无法正常工作,因为Azure存储不允许您进行服务器端wild card筛选.服务器端唯一可用的过滤选项是prefix过滤.

Unfortunately this won't work as Azure Storage does not allow you to do server-side wild card filtering. Only filtering option available to you server-side is prefix filtering.

因此,您要做的是列出以data/2014-开头的blob名称,然后在收到所有以data/2014-开头的blob名称后,将其余的过滤逻辑应用于客户端.

So what you would do is list blobs names of which starts with data/2014- and then apply rest of the filtering logic on the client side once you received all blobs names of which start with data/2014-.

let list = container.ListBlobs("data/2014-", false) // ! here
//Do client side filtering on the "list"

这篇关于在WASB ListBlob中使用通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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