1

I'm trying to retrieve the ownedObjects of a ServicePrincipal from the Microsoft Graph API using WithUrl because I didn't see any support for $expand in the Delta SDK.

When I run this code:

var deltaResponse = await graphClient.ServicePrincipals.Delta()
    .WithUrl("https://graph.microsoft.com/v1.0/servicePrincipals/delta/?$select=id&$expand=ownedObjects")
    .Request()
    .GetAsDeltaGetResponseAsync(
        requestConfiguration =>
        {
             requestConfiguration.Options.Add(retryHandlerOption);
             requestConfiguration.Headers.Add("Authorization", $"Bearer {accessToken}")
        },      cancellationToken);

I get the following exception:

oDataError = signing key is invalid

It seems that the WithUrl function ignores any properties in its input, so I can't pass the authorization bearer token via accessToken.

I don't necessarily need to use WithUrl—I just want to execute this query as efficiently as possible.

For example, when I tried:

var deltaResponse = await deltaRequestBuilder.GetAsDeltaGetResponseAsync(
                    requestConfiguration =>
                    {
                        requestConfiguration.ConfigureCommonRequestProperties(accessToken, _retryHandlerOption);
                        requestConfiguration.QueryParameters.Select =
                            ["ownedObjects"];
                    },
                    cancellationToken);

I got:

Exception - back link not supported: ownedObjects

Does anyone have any advice or solutions for this issue?

2
  • Do you use SDK v4 or SDK v5? Commented Jul 8 at 13:30
  • First of all, thank you for your comment! But sadly no.. Expand is unsupported in ServicePrincipal's Delta GetAsDeltaGetResponseAsync
    – IlayAsayag
    Commented Jul 9 at 8:53

0