Skip to content

ServicePrincipalsWithAppId does not have the same endpoints as ServicePrincipals["objectid"] #3013

@mariussm

Description

@mariussm

Is your feature request related to a problem? Please describe the problem.

I am trying to get all owned objects of a service principal by having only the appid. This works fine using Graph calls:

https://graph.microsoft.com/v1.0/serviceprincipals(appid='APPID')/ownedObjects

However, when using the SDK, ownedObjects does not exist under ServicePrincipalsWithAppId. Instead, this must be done using the objectid (which in my code, i do not have available):

var servicePrincipalOwnerOf = await client
                    .ServicePrincipals["OBJECTID"]
                    .OwnedObjects.GraphGroup.GetAsync(q => q.QueryParameters.Top = 999);

Describe the solution you'd like.

I would like for this to work the same way:

var servicePrincipalOwnerOf2 = await client
                    .ServicePrincipalsWithAppId("test")
                    .OwnedObjects.GraphGroup.GetAsync(q => q.QueryParameters.Top = 999);

Additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions