question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Getting odata.error "InvalidInput" when using Azurite and oData syntax with 'and' filter expression

See original GitHub issue

Library name and version

Azure.Data.Tables

Describe the bug

I use Azurite for local development.

I run this query. The two variables userName and userPW came from a query string (e.g. http://192.168.1.54:7015/api/Command?Login&userName=Peter&userPW=abc). I’m using Azure functions.

The following code runs via “await Task.Run(() => [class-instance].[methodname]”)

The weird is, when I hardcode the String “User eq ‘Peter’ and Password eq 'abc” it works fine and I got 1 result. But if I insert the variables, I’m getting the odata.error. Pageable<TableEntity> oDataQueryEntities = tableClient.Query<TableEntity> (filter: TableClient.CreateQueryFilter($"User eq '{userName}' and Password eq '{userPW}'"));

If I omit the second parameter, I’m also getting a result:

(filter: TableClient.CreateQueryFilter($"User eq '{userName}'"));

The table is there if I check it with the Storage Explorer.

Expected behavior

See above

Actual behavior

See above

Reproduction Steps

See above

Environment

Win10 Visual Studio Community 2022 17.6.2 Azure.Data.Tables 12.8.0 Azurite 3.22.0

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jsquirecommented, May 30, 2023

Thank you for your feedback. Tagging and routing to the team member best able to assist.

0reactions
github-actions[bot]commented, Jun 7, 2023

Hi @jk-85, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting OData collection filters - Azure Cognitive ...
Learn approaches for resolving OData collection filter errors in Azure ... These errors happen when you use a feature of filter expressions ......
Read more >
aztables
Azure Tables is a NoSQL data storage service that can be accessed from anywhere in the world via authenticated calls using HTTP or...
Read more >
OData Error: The query specified in the URI is not valid. ...
I am having the exact same problem. I actually cannot use any of the query syntax parameters, $count, $filter, $select, etc. They all...
Read more >
Getting error when trying to use name field as Odata filter
I am getting an error with Get Items when trying to use a name as a filter. If I try and do it...
Read more >
Basic Tutorial · OData - the Best Way to REST
The Open Data Protocol (OData) is a data access protocol built on core protocols like HTTP and commonly accepted methodologies like REST for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found