MS-graph API filter

testuser7 271 Reputation points
2021-09-03T16:04:41.62+00:00

Hello,

from graph-api point of view, I can pull up all the applications whose tags attribute has some literal string as shown below.

https://graph.microsoft.com/v1.0/applications?$filter=tags/any(s:s eq 'Request-number')

However, I can not do following.

https://graph.microsoft.com/v1.0/applications?$filter=tags/any(s:s startsWith 'Request-number')

Appreciate if you help me how can I pull up all the applications which have tag that start with Request-number.
Tags is nothing but collection of strings.
I do not know the full string but I do know it starts with 'Request-number'

Thanks.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,569 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Korrakuti, Paramesh 6 Reputation points
    2021-09-27T18:38:20.127+00:00

    GET https://graph.microsoft.com/v1.0/applications?$filter=tags/any(c:c eq 'Request-number') worked fine for me.

    Used the below Java code snippet to apply the filter on tags.

    ApplicationCollectionPage appPage = getGraphApiClient().applications().buildRequest()
                    .select("id,appId,identifierUris,appRoles,signInAudience")
                    .filter("tags/any(c:c eq 'application_type:resource_server')").get();
    
    1 person found this answer helpful.
    0 comments No comments

  2. Roderick Bant 2,046 Reputation points
    2021-09-05T19:09:00.107+00:00

    I'm not in an oppotunity to this right now, but I think the filter should have a little different syntax like: https://graph.microsoft.com/v1.0/applications?$filter=startsWith(tags/any(s:s, 'Request-number')

    Please let me know if that works for you