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

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Connect BC 160 OnPrem to Common Data Service troubleshooting

(0) ShareShare
ReportReport
Posted on by 120

Hello everybody.

We'are experiencing problems in connecting  Business Central OnPremise installation to a Common Data service environment. Some information first, BC is an 160 version hosted on a Windows 10 Azure VM with SSL certificate binding for BC installed and done.

We followed the instructions as described in this article https://docs.microsoft.com/en-us/dynamics365/business-central/admin-how-to-set-up-a-dynamics-crm-connection, we've registered an app, we provided the necessary api permissions and made a secret key. Browsing back to BC, to Common Data Service Connection Setup, using Office365 authentication we provided the redirect url (which should be SERVER:443/.../OAuthLanding.htm to both here and to Azure app), Client id and secret key. When we tried to enable the connection, we've been asked to sign in with the an active directory admin user, and then give our consent to the necessary permissions the app requested. After done all these and clicked accept, a new pop up window opens up for seconds redirecting to https://SERVER:443/Instancename/OAuthLanding.htm?code=huge number of letters following here but after some seconds this window closes down and nothing else happens.

Back to the setup we getthe generic error Failed to Acquire and Access Token.

Any idea what else to check? We've tried disabling the server firewalls, we've tried to replace the Microsoft.Identity.Client.dll  to an older version as described in release note 369662 at https://support.microsoft.com/en-us/help/4576664/update-16-5-for-microsoft-dynamics-365-business-central-2020-release-w but nothing seems to work so far. One thing that could help is that when trying to browse to https://SERVER:443/Instancename/OAuthLanding.htm directly from a browser it leads to an empty page. Any ideas?

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Connect BC 160 OnPrem to Common Data Service troubleshooting

    Hello,

    Based on success stories in these support request, I compiled a new postings.

    community.dynamics.com/.../when-trying-to-enable-connection-to-cds-dataverse-from-onprem-business-central-an-error-may-occur

    Hope it helps.

    Thanks.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Connect BC 160 OnPrem to Common Data Service troubleshooting

    Hello Giannis,

    There are two partners that did mention the workaround did not work for them. For me it does work, so I am scheduling a Teams session with them today or on Tuesday to see what breaks it for them and we may be able to fix it with some adjustments here and there. Their latest event log file does not show the file error so we are one step further.

    But again, it does work for me with latest CU for 16, so something else may be needed which is not what I am can gather from the logs they shared with me.

    Thanks.

  • Giannis Tsak Profile Picture
    120 on at
    RE: Connect BC 160 OnPrem to Common Data Service troubleshooting

    Hello Marco.

    We've tried the workaround and then we updated our version to 16.7 but no luck. No wonder because it's not the security-category error you are mentioning above. It's strange when we are test the connection everything appears right but it seems that there is something else that we are missing at the setup that leads to failure on importing the solution.

    Regardless, thank you for your feedback.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Connect BC 160 OnPrem to Common Data Service troubleshooting

    Hello,

    Just to let you know I was able to resolve the issue (using 16.4).

    The reason it fails is because of this error:

    Server instance: BC160
    Category: Security
    ClientSessionId: a0ba0e9d-d112-4c5e-8dea-8e8fa5412b0f
    ClientActivityId: ec8a84bd-2a70-4251-8e8e-268bb41b75ac
    ServerSessionUniqueId: 2c17058e-2cab-4326-878a-4d98ddb55626
    ServerActivityId: a1f0fd11-fb1a-4f54-9e49-89fcd57363ec
    EventTime: 11/23/2020 15:17:36
    Message (FileLoadException): RootException: FileLoadException
    Could not load file or assembly 'Microsoft.Identity.Client, Version=4.5.1.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    ExceptionStackTrace:

     You will have to search for it yourself in the application event log files, a set of events are popping up when you try to enable. One of them shows this error (if your root cause is similar as mine). 

    Please download this package and unzip it via 7Zip:
    https://www.nuget.org/packages/Microsoft.Identity.Client/4.5.1.0

    From folder .\microsoft.identity.client.4.5.1\lib\net45 copy the two files into the folder C:\Program Files\Microsoft Dynamics 365 Business Central\160\Service, After that, restart the service tier. I did test the scenario first with AAD Authentication and then I switched back again to Windows authentication for NST / IIS and it continued to work.

    This does only apply if you see the event with the specific exception and the 4.5.1.0 expectation.

    Hope it will work for you as well.

    Thanks.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Connect BC 160 OnPrem to Common Data Service troubleshooting

    Hello,

    I will try this out as well. I do have a repro with Windows authentication, but can easily confirm with NavUserPassword. All my instances have been configured with AAD authentication.

    Thanks.

  • Giannis Tsak Profile Picture
    120 on at
    RE: Connect BC 160 OnPrem to Common Data Service troubleshooting

    Hello Marco.

    I was afraid so. We are using NavUserPassword since the server is standalone. Ιn the cds connection setup we are using office365 authentication to enable the connection.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Connect BC 160 OnPrem to Common Data Service troubleshooting

    Hello,

    That may be the best, what type of authentication are you using? Windows authentication?

    Thanks.

  • Giannis Tsak Profile Picture
    120 on at
    RE: Connect BC 160 OnPrem to Common Data Service troubleshooting

    Hello Marco.

    We are on 16.5 release. Yes, I've read the original post where you mentioned this workaround. Our error in the application log has a difference that the Parent Exception is not a NavNCLDialogException but rather a NavNSValidateFieldException. It doesn't look like a file load exception but rather a failure to validate a field. In the end I assume there's nothing we can try and a support ticket is the only way to proceed? 

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Connect BC 160 OnPrem to Common Data Service troubleshooting

    Hello,

    Currently there are two partners that are on 16.4 where that workaround does not work. The workaround does work for me with v16.5 (or 16.4, not sure what release I was working with when we generated the workaround). At the moment I am setting up a 16,4 environment to see if I am able to repro the issue.

    Are you as well on 16.4 release?  If the files to be replaced are not OK, you will have a file load exception in application event log file. One of the partners does have that issue, but the other partner has other issues in the application event log file. That is why the both raised a support ticket which I am currently working on.

    Thanks.

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,869 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,484

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,242

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans