Hello. We have a console app which imports and updates records to our (cloud) dynamics 365 from a SQL table using OrganizationRequestCollection/ExecuteMultipleRequest
If the number of records processed is low there is no issue. Often there is no issue with processing "high" volumes (15k -20k records) but sometimes (- with no consistent cause - it actually seems to vary from job-run to job-run) the import stops (*NOT immediately, but randomly after processing 10 or 14 "chunks" (of 500 rows) with the following error:
error The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer authorization_uri=login.microsoftonline.com/guid_which_i_can’t_reconcile/oauth2/authorize, resource_id=https://our_dynamics_ 365_ url'.
I can't stress enough - , the error is inconsistent - 95% of the time it does not occur but when it does, I have no control over the cause - it seems to be dependent on time-of-run.
Does anyone know (a) what this error means and (b) how to stop it - note the "unauthorised" is strange because it displays this error DURING processing rather than at the start so is there some sort of token or authorisation which needs to be renewed or set to persist forever?
Very grateful for any help or advice,
Thanks,
- Seamus