Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter substringof and top parameter cannot work together in Resources#List #6967

Closed
ArcturusZhang opened this issue Aug 15, 2019 · 4 comments
Assignees
Labels
ARM - Core Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@ArcturusZhang
Copy link
Member

ArcturusZhang commented Aug 15, 2019

When I call rest api

/subscriptions/${subscriptionId}/resources?$top={top}&api-version=2018-05-01&$filter={filter}

and filter contains a clause of substringof, then the top parameter will be ignored.

To reproduce:

I used Postman to send this rest api request. Armclient or az CLI cannot get the filter in this request to work. I filed another issue about this in the armclient repo.

Use postman and call GET

https://management.azure.com/subscriptions/${subscriptionId}/resources?$top=2&api-version=2018-05-01&$filter=substringof('test', name)

Expected behaviour: Getting a response with 2 entries with name contains test in them and a nextLink for a url that I can fetch rest part of the full result list.

Actual behaviour: Getting a full list of filtered resources, as if the top parameter get ignored.

If I replace this filter with another one without substringof clause, the top parameter works fine.

@akning-ms akning-ms added ARM - Core Service Attention Workflow: This issue is responsible by Azure service team. labels Apr 23, 2020
@ghost
Copy link

ghost commented Apr 23, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure.

@snaheth
Copy link
Contributor

snaheth commented Sep 1, 2020

@ArcturusZhang - Not sure how no one looked at this yet but here I am 😄 I see that this issue still exists even in the new api-version so I'll add this to our backlog to address.

@tim-nguyen-cs tim-nguyen-cs self-assigned this Jul 27, 2021
@DeloitteAnwarBashaP
Copy link

@ms
Any update for this issue?

@tim-nguyen-cs
Copy link
Contributor

Hi @DeloitteAnwarBashaP , while investigating this issue previously, we ran into a conflict with how resources are queried, which prevented the proper number of resources from being returned. Because this is a design constraint, the observation is to be expected, and the relevant documentation for this API has been updated with the following note: Note that any truncated number of results queried via $top may also not be compatible when using a filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM - Core Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants