Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure TableQuery With Regular Expressions

Is there a way to query Azure for PartitionKeys that match a certain regular expression instead of just equality?

For example:

My Azure Storage Table PartitionKeys: CA94568, CA92122, CA92092, WA98005

Sample Query #1:

tableQuery = new TableQuery<Entry>().Where(TableQuery.GenerateFilterCondition(PartitionKey, QueryComparisons.Equal??,  "CA.*"));

Query Results #1: "CA94568, CA92122, CA92092"

Sample Query #2:

tableQuery = new TableQuery<Entry>().Where(TableQuery.GenerateFilterCondition(PartitionKey, QueryComparisons.Equal??,  "CA92.*"));

Query Results #2: "CA92122, CA92092".

like image 827
corgichu Avatar asked May 01 '26 17:05

corgichu


1 Answers

I don't believe so. Azure Table Storage does not support any operations except equal, greater than, or less than. Everything else has to be interpreted on the client side.

So you could download of all of the table in memory via ToList and then perform queries as you see fit.

like image 53
Igorek Avatar answered May 04 '26 06:05

Igorek