Wednesday, March 15, 2023

Dynamics 365 FO Unable to connect to target server localhost


Dynamics 365 FO Importing issue : Unable to connect to target server 'localhost'


"Changes to connection setting default values were incorporated in a recent release. More information is available at https://aka.ms/dacfx-connection *** Error importing database: Could not import package. Unable to connect to target server 'localhost'. Please verify the connection information such as the server name, login credentials, and firewall rules for the target server. A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) The certificate chain was issued by an authority that is not trusted. *** The settings for connection encryption or server certificate trust may lead to connection failure if the server is not properly configured"

While importing data when you get the above error, just add the /ttsc:true sqlpackage argument to trust the cert for the import action as shown below


SqlPackage.exe /a:import /sf:C:\DBBackup\ConsTestbackup.bacpac /tsn:localhost /tdn:UAT /ttsc:true /p:CommandTimeout=1200