Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Problem Connecting to Dynamics using XRM Tooling

Posted on by 39

Good Day, 

I have been searching through alot of post on the different messageboards, however i haven't found any that resolved my issue. 

i am trying to dynamics 365 using XRM tooling. It worked perfectly a month ago, however it suddenly stopped. 

After investigation it looks like it gets the environment information fine from the CrmServiceClient connection string, however, the user authentication isnt getting recognised. the OAuthuserid is empty("") and the OrganizationServiceProxy is all null.  

I have a suspicion that it has something to do with the version, the CRM Version is now 9.1.0.14432 , while the SDKVersionProperty is still 9.0.44.892.

i know my connection string is correct, seeing it was working perfectly fine a month ago.  the format i used is as follows. 

<connectionStrings>  
    <add name="Dynamics365Connection" connectionString="AuthType=Office365;Username=jsmith@contoso.onmicrosoft.com; Password='enterpasswordhere';Url=">contoso.crm.dynamics.com;RequireNewInstance=True;" />  
</connectionStrings>  



6048576.Capture.PNG

does anyone know if there is a new requirement when doing api connections using xrmtooling ?
Thanks
  • kale williams Profile Picture
    kale williams 39 on at
    RE: Problem Connecting to Dynamics using XRM Tooling

    sorry,

    by safe I mean would it be deprecated completely and I would eventually be forced to switch over anyways.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Problem Connecting to Dynamics using XRM Tooling

    What do you mean safe? If you don't plan to put this connection string to place that is available to multiple people - it's safe. It's recommended to use oAuth authentication so you can got that path as well.

  • kale williams Profile Picture
    kale williams 39 on at
    RE: Problem Connecting to Dynamics using XRM Tooling

    Is the O365 authentication safe to use ? as it says in the link you provided that I should use the oAuth method and create an app on azure AD.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Problem Connecting to Dynamics using XRM Tooling

    You can use execute. Something like:

    var client = new CrmServiceClient("connectionstringhere");

    var WhoAmIResponse = client.Execute(new WhoAmIRequest()) as WhoAmIResponse;

  • kale williams Profile Picture
    kale williams 39 on at
    RE: Problem Connecting to Dynamics using XRM Tooling

    How do I use the CrmServiceClient instance to do something like a WhoAmI ? or an execute ?

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Problem Connecting to Dynamics using XRM Tooling

    Hello,

    Connection string should look like following:

      
          
     

    Just doublecheck that there is no additional quotes and so on.

    Inside your code just stop using Proxy - check this post - https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/authenticate-office365-deprecation

    Just use CrmServiceClient instance - it exposes all required CRUD and Execute methods.

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

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans