Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

Performance degradation when using CrmServiceClient and AuthType OAuth in Dataverse

(2) ShareShare
ReportReport
Posted on by 80

I've got an MVC.NET solution that calls the Dataverse API and I'm seeing a significant performance degradation when using CrmServiceClient and AuthType=OAuth compared with the (soon to be deprecated) WS-Trust connection (AuthType=Office365)

This is the code used for creating the CrmServiceClient connection (AuthType=OAuth)

var conn = new CrmServiceClient(connectionString);

var service = (IOrganizationService) conn.OrganizationWebProxyClient ?? conn.OrganizationServiceProxy;

and this is the code used for creating WS-Trust connection (AuthType=Office365)

var target = CrmConnection.Parse(connectionString);
            
target.ServiceConfigurationInstanceMode = ServiceConfigurationInstanceMode.PerName; 

var service = (OrganizationService) CrmConfigurationManager.CreateService(target, "DataverseServiceName");

has anyone experienced the same issue?

  • juancho Profile Picture
    juancho 80 on at
    RE: Performance degradation when using CrmServiceClient and AuthType OAuth in Dataverse

    In our case the issue was that we were using an old version of the CrmSdk, using the latest version (9.0.2.42) solved our problem

    www.nuget.org/.../9.0.2.42

    We also have issues with impersonation when setting the caller id (docs.microsoft.com/.../microsoft.xrm.tooling.connector.crmserviceclient.callerid, if you are running several threads and initiating multiple connections with different callerids, we found that it's not thread safe and some calls to impersonate one user might get mixed up by another user even if:

    - disablecrossthreadsafeties is set to false (docs.microsoft.com/.../microsoft.xrm.tooling.connector.crmserviceclient.disablecrossthreadsafeties

    - RequireNewInstance is set to true (docs.microsoft.com/.../use-connection-strings-xrm-tooling-connect

    We ended up having to cache each IOrganizationService per callerid to prevent it

  • Franji Profile Picture
    Franji 25 on at
    RE: Performance degradation when using CrmServiceClient and AuthType OAuth in Dataverse

    Hello,

    We too have started to get that performance degradation when we start using AuthType=OAuth, we are also using CrmServiceClient to connect.

    Have you found any solution? The truth is that it is penalizing us a lot.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans