exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 4 question 60 discussion

Actual exam question from Microsoft's AZ-204
Question #: 60
Topic #: 4
[All AZ-204 Questions]

HOTSPOT
-

You develop a web app that interacts with Azure Active Directory (Azure AD) groups by using Microsoft Graph.

You build a web page that shows all Azure AD groups that are not of the type 'Unified'.

You need to build the Microsoft Graph query for the page.

How should you complete the query? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
mmdex
Highly Voted 2 years, 2 months ago
~/groups?$filter=NOT groupTypes/any(c:c eq 'Unified')&$count=true This exact example is mentioned in Microsoft documentation: https://learn.microsoft.com/en-us/graph/filter-query-parameter?tabs=http#examples-using-the-filter-query-operator
upvoted 43 times
c_mazzotta
2 years ago
Agree. if you try:"$filter=groupTypes/any(s:s ne 'Unified')&$count=true", you get: "Using 'ne' inside 'any' clause is invalid. Suggestion: consider using the 'not' operator instead."
upvoted 1 times
...
warchoon
2 years, 1 month ago
=> https://learn.microsoft.com/en-us/graph/filter-query-parameter?tabs=http#examples-using-the-filter-query-operator:~:text=~/groups%3F%24filter%3DNOT%20groupTypes/any(c%3Ac%20eq%20%27Unified%27)%26%24count%3Dtrue
upvoted 4 times
...
CarlosTheBoldest
1 year, 4 months ago
Not sure since then but now it supports the ne parameter too: "As Microsoft Entra ID continues to deliver more capabilities and improvements in stability, availability, and performance, Microsoft Graph also continues to evolve and scale to efficiently access the data. One way is through Microsoft Graph's increasing support for advanced query capabilities on various Microsoft Entra ID objects, also called directory objects, and their properties. For example, the addition of not (not), not equals (ne), and ends with (endsWith) operators on the $filter query parameter." https://learn.microsoft.com/en-us/graph/aad-advanced-queries?tabs=http#count-of-a-collection-in-a-filter-expression
upvoted 4 times
...
...
g2000
Highly Voted 2 years, 3 months ago
it is correct https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-always-encrypted?tabs=dotnet
upvoted 7 times
tcybu
2 years, 3 months ago
Agreed, it's correct, but here're the links with explanation https://learn.microsoft.com/en-us/graph/filter-query-parameter?tabs=http#any-operator https://learn.microsoft.com/en-us/graph/aad-advanced-queries
upvoted 2 times
...
...
ciamp
Most Recent 8 months, 1 week ago
GET ~/groups?$filter=NOT groupTypes/any(c:c eq 'Unified')&$count=true **
upvoted 1 times
...
8ac3742
8 months, 3 weeks ago
Using the filter groupTypes/any(s:s ne 'Unified') is not supported in Microsoft Graph queries. The ne (not equal) operator is not valid within the any lambda function12.
upvoted 1 times
...
Maskoo
1 year, 3 months ago
It's D The 'ne' is not supported by default, we need count=true AND consistency level set to eventual which is not possible with this question.
upvoted 1 times
fuji36850
12 months ago
This works OK in graph: https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/any(c:c eq 'Unified')
upvoted 1 times
...
...
130nk3r5
1 year, 4 months ago
ne (Not Equals) is now supported.
upvoted 4 times
...
Acelexout
1 year, 7 months ago
From documentation (https://learn.microsoft.com/en-us/graph/filter-query-parameter?tabs=http#examples-using-the-filter-query-operator): List all non-Microsoft 365 groups in an organization. GET ~/groups?$filter=NOT groupTypes/any(c:c eq 'Unified')&$count=true*
upvoted 3 times
...
BaoNguyen2411
1 year, 9 months ago
got this question on 06/29/2023
upvoted 4 times
...
BaoNguyen2411
1 year, 9 months ago
Got this answer on 06-29-2023
upvoted 3 times
...
Dianahu
1 year, 9 months ago
Just try it yourself here: https://developer.microsoft.com/en-us/graph/graph-explorer https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/any(s:s ne 'Unified')&$count=true -> 400 https://graph.microsoft.com/v1.0/groups?$filter=not groupTypes/contains('Unified')&$count=true -> 400 https://graph.microsoft.com/v1.0/groups?$filter=not groupTypes/any(s:s eq 'Unified')&$count=true -> 200 with ConsistencyLevel: eventual https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/contains('Unified') eq false&$count=true -> 400
upvoted 2 times
fuji36850
12 months ago
Now it works fine.
upvoted 1 times
...
...
nekkilodeon
2 years ago
From Microsoft documentation https://learn.microsoft.com/en-us/graph/filter-query-parameter?tabs=http#examples-using-the-filter-query-operator List all non-Microsoft 365 groups in an organization. GET ~/groups?$filter=NOT groupTypes/any(c:c eq 'Unified')&$count=true*
upvoted 1 times
...
Heighte
2 years ago
any idea why $count=true though?
upvoted 5 times
...
Tomn82
2 years, 1 month ago
Answer ~/groups?$filter=NOT groupTypes/any(c:c eq 'Unified')&$count=true Option 2: Use the $filter query parameter with the ne operator. This request is not supported by default because the ne operator is only supported in advanced queries. Therefore, you must add the ConsistencyLevel header set to eventual and use the $count=true query string. https://learn.microsoft.com/en-us/graph/aad-advanced-queries?tabs=http
upvoted 1 times
...
baroo1
2 years, 2 months ago
Answer: /groups?$filter=not groupTypes/any(s:s eq 'Unified')&$count=true It also requires an extra header ConsistencyLevel: eventual "ne" is not supported. message": "Using 'ne' inside 'any' clause is invalid. Suggestion: consider using the 'not' operator instead. For example: $filter=not groupTypes/any(x:x eq 'Unified')
upvoted 2 times
vmakharashvili
2 years, 1 month ago
I don't think so. I see if you want to use negative this way, you have to set parenthesis after not. like this: /groups$filter=not(groupTypes/any(s:s eq 'Unified'))
upvoted 1 times
...
...
Net_IT
2 years, 2 months ago
IMO it should be filter=NOT groupTypes/any(s:s eq 'Unified')&$count=true. Source: https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-always-encrypted?tabs=dotnet In advanced querries you can also use the ne operator but then the consistencylevel has to be put to eventual and I'm not sure that's the case here?
upvoted 1 times
...
eugene1234
2 years, 2 months ago
The answer is wrong! 1. filter should be $filter, and the expression should be NOT groupTypes/any(s:s ne 'Unified'), we want records that are NOT unified, see examples at https://learn.microsoft.com/en-us/graph/filter-query-parameter?tabs=http
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago