Azure / azure-cosmos-table-dotnet

.NET SDK for Azure Cosmos Table API
14 stars 6 forks source link

Querying Azure Table fails #42

Open ahumeniy opened 4 years ago

ahumeniy commented 4 years ago

When using the API version 1.0.6 and trying to do a filter query I get empty results.

Checking with Fiddler the request URL has the single quotes escaped:

Original query (tested in MS Azure Storage Explorer): PartitionKey eq 'user@domain.com'

Request made with API (does not work): GET /table?$filter=PartitonKey%20eq%20%27user%40domain.com%27

Manually crafted request which work: GET /table?$filter=PartitonKey%20eq%20%'user%40domain.com'

Notice the single quotes are escaped on the incorrect request.

I'm querying Azure tables, not Cosmos DB, maybe there's a breaking change which render this API incompatible with that?

PaulCheng commented 4 years ago

If you use TableQuery.GenerateFilterCondition(nameof(TableEntity.PartitionKey), QueryComparisons.Equal, "'user@domain.com'"), it should work properly.