Negation in filter on Azure resource graph

Fred BRACHOT 26 Reputation points
2022-06-22T08:09:53.18+00:00

Hi,

When I run the query: https://graph.microsoft.com/v1.0/devices?$filter=onPremisesSyncEnabled ne true
I get the error "Unsupported property filter clause operator 'NotEqualsMatch'."

The request: https://graph.microsoft.com/v1.0/devices?$filter=onPremisesSyncEnabled eq true
It works well

However in the doc (https://learn.microsoft.com/en-us/graph/api/resources/device?view=graph-rest-1.0#properties) it is well written that it is possible to use the negation in a filter on this property

I also tried using not eq, but also couldn't get the query to work.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,746 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 37,466 Reputation points
    2022-06-22T09:17:24.303+00:00

    Hi @Fred BRACHOT

    The not and ne negation operators are supported only with advanced queries.

    GET https://graph.microsoft.com/v1.0/devices?$filter=onPremisesSyncEnabled ne true&$count=true  
    ConsistencyLevel:eventual  
    

    213793-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful