When an application queries a relationship that returns a directoryObject type collection, if it doesn't have permission to read a certain resource type, members of that type are returned but with limited information. For example, only the @odata.type property for the object type and the id is returned, while other properties are indicated as null. With this behavior, applications can request the least privileged permissions they need, rather than rely on the set of Directory.* permissions. For details, see Limited information returned for inaccessible member objects.
HTTP request
You can address the service principal using either its id or appId. id and appId are referred to as the Object ID and Application (Client) ID, respectively, in app registrations in the Microsoft Entra admin center.
HTTP
GET /servicePrincipals/{id}/createdObjects
GET /servicePrincipals(appId='{appId}')/createdObjects
GET https://graph.microsoft.com/v1.0/servicePrincipals/00063ffc-54e9-405d-b8f3-56124728e051/createdObjects
C#
// Code snippets are only available for the latest version. Current version is 5.x// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharpvar result = await graphClient.ServicePrincipals["{servicePrincipal-id}"].CreatedObjects.GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v1.*// Dependenciesimport (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
createdObjects, err := graphClient.ServicePrincipals().ByServicePrincipalId("servicePrincipal-id").CreatedObjects().Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DirectoryObjectCollectionResponse result = graphClient.servicePrincipals().byServicePrincipalId("{servicePrincipal-id}").createdObjects().get();
# Code snippets are only available for the latest version. Current version is 1.xfrom msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.service_principals.by_service_principal_id('servicePrincipal-id').created_objects.get()
Diğer geliştiriciler ve uzmanlarla gerçek dünyadaki kullanım örneklerini temel alan ölçeklenebilir yapay zeka çözümleri oluşturmak için toplantı serisine katılın.