Warm tip: This article is reproduced from serverfault.com, please click

InternalServerError when calling the synchronization API's

发布于 2020-12-01 17:12:56

I'm looking for a way to automate the process of updating admin credentials inside an enterprise app in AAD. Looking at the Microsoft docs e.g. here this should be possible via the graph api. Whenever I attempt these steps I'm running into "InternalServerError" along with "Microsoft.Graph.ServiceException: Code: UnknownError".

My dotnet code for validating existing credentials is the following.

await graphServiceClient.ServicePrincipals[$"{servicePrincipalId}"].Synchronization.Jobs[$"{jobsId}"]
                .ValidateCredentials(null,null,null,credentials)
                .Request()
                .PostAsync();

The result is the error above with the same error for any other synchonization method. I've considered it could be a permissions issue but I've found that the api does a reasonable job of sending permission issues back so I'm stumped at this point.

Does anybody have any advice on this?

Questioner
theor
Viewed
0
Dev 2020-12-02 21:11:37

I see that you're updated that "The result is the error above with the same error for any other synchronization method". In such scenario, I would do the basic sanity checks

  • Validate the credentials that you're using
  • Make sure the user context has necessary scopes/roles defined too
  • Make sure the template and the parameters that you're is correct.
  • Once you assigned app role to the user that you're using for delegating permissions, it worked for you.