microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

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

Open
#3,013 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs investigation type:feature
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the ServicePrincipals["OBJECTID"].OwnedObjects.GraphGroup.GetAsync path with ServicePrincipalsWithAppId("test") and the corresponding Microsoft Graph appid endpoint. Start by locating the request-builder entry points for both paths. Done means the appid path exposes the same OwnedObjects.GraphGroup request and supports the shown GetAsync call.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.