msgraph-sdk-dotnet icon indicating copy to clipboard operation
msgraph-sdk-dotnet copied to clipboard

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

Open mariussm opened this issue 3 months ago • 0 comments

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

mariussm avatar Oct 09 '25 08:10 mariussm