web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Visual Studio Connection String to CRM on premise - Not Working

(0) ShareShare
ReportReport
Posted on by

Hi there,

I'm used to connecting to a CRM Online instance with a unique orgID, however I now need to connect to an on-premise instance of Dynamics CRM and it gives me an error saying:

"Unable to connect to data source 'Test'.The connection to server "crm.mycompanyname.co.za/.../Organization.svc" could not be established. Make sure that the connection string and credentials are correct, and try again."

I am confident that my credentials are correct, and when I connect to the URL https://crm.mycompanyname.co.za I can login to Dynamics CRM just fine.

Having checked the Developer Resources, I see the following:

I've reviewed all the other articles and tried a myriad of different connection strings, but I get the feeling these connection strings are all for CRM Online. Is there a different method for connecting to CRM on premises?

My version of CRM is Microsoft Dynamics® CRM 2016 (8.1.0.359) (DB 8.1.0.359)

I'm at my wits end, struggling to connect to this instance - any help is appreciated.

*This post is locked for comments

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Can you please provide a screenshot of connection string window with combination that you try?

  • Suggested answer
    Tushar2016CRM Profile Picture
    1,130 on at

    HI ,

    You may need to make sure that the proper ports are opened to your CRM Servers from the one where your VS is installed .

    Thanks!

  • wi11iamr Profile Picture
    on at

    Hi Andrii,

    Attached 3 screenshots showing the detail I have under Developer Resources, and two examples I've tried in the Connection String.

    Thanks

    William R.

    CRM-Connection-Issues-_2D00_-Screenshot-1.PNGCRM-Connection-Issues-_2D00_-Screenshot-2.PNGCRM-Connection-Issues-_2D00_-Screenshot-3.PNG

  • wi11iamr Profile Picture
    on at

    Hi Tushar, can you confirm what ports would need to be opened?

    Although the Dynamics server is on premise, I can access it via the Internet. When trying to connect, I've tried via the Internet as well as the company VPN, and neither options have worked.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Just to be sure. Have you entered credentials to "Credentials" box?

    Another question - have you tried to connect to your CRM using other tools like XrmToolbox or Developer Toolkit? I had similar issue when ADFS was not configured properly and I was able to connect to CRM using browser but connection attempts to connect to CRM using tools failed.

  • Suggested answer
    Tushar2016CRM Profile Picture
    1,130 on at

    HI ,

    Please find more information about the ports below .

    msdn.microsoft.com/.../dn683916(v=crm.6).aspx

    Thanks !

  • Inogic Profile Picture
    703 on at

    Hi William,

    It seems that you have configured IFD for your CRM organization.
    To verify the URL being entered by is correct or not, you could create a report using Report Wizard from within CRM. Once you created it download the RDL of the same report and then include it in your solution and check the URL and credentials for that report. Now you can use the same URL and the credentials in your custom report.


    Hope this helps!

    Thanks!
    Sam

  • wi11iamr Profile Picture
    on at

    Hi Andrii,

    I've managed to connect successfully using XRMToolbox, and only because it guided me through a process of asking me for the URL of the Dynamics instance (for which I entered "https://crm.mydomainname.za") and confirming whether it was an IFD (Internet Facing Deployment), to which I answered "No".

    Thereafter XMToolbox was able to obviously derive the correct connection string details and I can now execute FetchXML queries against the CRM instance.

    The trouble now is that I cannot see in XRMToolbox what the exact Connection String is that it is using, so that I can copy that and paste it in the "Microsoft Dynamics Fetch CRM" data type connection string within Visual Studio.

    Do you perhaps know how to check within XRMToolbox what the actual connection string is that it has created?

  • wi11iamr Profile Picture
    on at

    Hi Inogic, it's unfortunately not my system, I'm just helping to write some reports, so I cannot confirm or deny the configuring of IFD. I'm also not entirely sure I know what's going on here as I've only worked on CRM online instances before, but curiously enough I can access the on-premise CRM instance via the internet, and don;t need to rely on being connected via the VPN in order to work with XRMToolbox.

    Following your suggestion though, I managed to download a custom report I just made and interestingly enough it has a datasource connection string of https://dev.mydomainname.za/;CRM

    Should I be worried about the "dev" part of this connection string?

    That aside though, when I try to create a new report with the same above connection string, I still get the error:

    "Unable to connect to data source 'DataSource1'.An authentication error occurred while connecting to server "dev.mydomainname.za/.../Discovery.svc". Make sure that the connection string and credentials are correct, and try again."

  • wi11iamr Profile Picture
    on at

    Looking at the error message now though, it no longer complains like the first error (check screenshot in above posts) about not being able to make a connection. The error now is very specifically about not being able to authenticate, thus it confirms that I at least have the correct Connection string now, but for some reason I'm not permitted to access it via Visual Studio...?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans