As discussed here, you cannot use $expand
in advanced queries currently. Furthermore $count
is only supported on some directory objects (such as applications) currently and only in advanced queries. Therefore, based upon the docs, you cannot currently combine $count
and $expand
on the same call for applications.
Query parameter COUNT is not supported along with EXPAND?
When I use $expand query parameter along with $count, count is not supported in Graph api?
https://graph.microsoft.com/v1.0/applications?$count=true&$expand=owners
$count doesn't work even if I change the order like put $expand first and put $count next.
Can someone please shed some light if there is a way I can get the count after expanding the root elements?
Thanks!
2 answers
Sort by: Most helpful
-
Michael Taylor 48,656 Reputation points
2022-12-19T15:42:44.51+00:00 -
Srinivasa Rao Darna 6,696 Reputation points Microsoft Vendor
2022-12-19T15:46:33.77+00:00 Hello @Madhura Lodam ,
$count=true
in Azure AD Graph APIs are using in combination withConsistencyLevel: eventual
header with Advanced query capabilities on Azure AD directory objects along with$seach
or specific$filter
.You can refer to this example to get a count of applications.
GET https://graph.microsoft.com/v1.0/applications/$count ConsistencyLevel: eventual
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".