Share via

msgraph quarry error.

abbas izadipour 210 Reputation points
2023-06-27T23:03:55.9+00:00

I am studying MS-600 and working on the following exercise:

https://learn.microsoft.com/en-us/training/modules/msgraph-extensions/3-exercise-onpremises-extension-attributes

The following queries work well:

GET https://graph.microsoft.com/v1.0/users?$select=id,displayName,userPrincipalName,onPremisesExtensionAttributes

PATCH https://graph.microsoft.com/v1.0/users/6e03a2db-564a-47ec-ba51-d0cd38af069a Content-type: application/json { "onPremisesExtensionAttributes": { "extensionAttribute13": "www.linkedin.com/in/adelevanceonlinkedIn", "extensionAttribute14": "AdeleV", "extensionAttribute15": "AwesomeAdele" } }

However, when I attempt the following query:

GET https://graph.microsoft.com/v1.0/users?$filter=onPremisesExtensionAttributes/extensionAttribute13 ne null or onPremisesExtensionAttributes/extensionAttribute15 ne null&$count=true&$select=id,displayName,userPrincipalName,onPremisesExtensionAttributes ConsistencyLevel: eventual

It returns the following error:

{ "error": { "code": "Request_UnsupportedQuery", "message": "Filter operator 'NotEqualsMatch' is not supported.", "innerError": { "date": "2023-06-27T22:56:24", "request-id": "de5533fd-a471-4683-8f4e-26c255c46a0c", "client-request-id": "3c850a81-6795-712a-21d0-85f6f4ae0915" } } }

I understand the different parts of the query, but I can't fix the error.

Any help would be appreciated.

Microsoft Security | Microsoft Graph
0 comments No comments

2 answers

Sort by: Most helpful
  1. Mirna Jammoul [Entelligence] 0 Reputation points
    2024-04-15T13:26:02.14+00:00

    To resolve the issue, you can include the ConsistencyLevel: eventual attribute in the header of your request. This attribute ensures that your query is executed with eventual consistency, which can be particularly helpful in cases where the data might not be immediately consistent across all replicas.

    In .NET, you can achieve this by creating an HttpRequestMessage object and adding the ConsistencyLevel header before sending the request. Here's an example:

    csharpCopy code
    HttpRequestMessage request = 
    

    By including this header attribute, you can potentially mitigate errors related to unsupported filter operators, as it ensures a consistent behavior in retrieving data from the Microsoft Graph API.

    Was this answer helpful?

    0 comments No comments

  2. Vasil Michev 126.3K Reputation points MVP Volunteer Moderator
    2023-06-28T07:09:27.35+00:00

    The following query works fine for me:
    GET https://graph.microsoft.com/v1.0/users?$filter=onPremisesExtensionAttributes/extensionAttribute13 ne null or onPremisesExtensionAttributes/extensionAttribute15 ne null&$count=true&$select=id,displayName,userPrincipalName,onPremisesExtensionAttributes

    Make sure you're correctly specifying the required header value (case sensitivity matters) and use the $count operator in order to enable the advanced query above.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.