D365 Database import - Unable to connect to target server localhost - Error occurred during the login process
I was facing an error when trying to import my D365 UAT .bacpac (database backup) file to my cloud-hosted develpment environment.
In order to fix that, you need to add the "TargetTrustServerCertificate" and set it to Yes. Since we are using the sqlpackage here, therefore we have to add the parameter /ttsc:True. (See SqlPackage parameters here).
Your database import command will look like this:
*** 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.
Changes to connection setting default values were incorporated in a recent release. More information is available at https://aka.ms/dacfx-connection
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.
Time elapsed 0:00:16.30
Error importing database:Could not import package.
Changes to connection setting default values were incorporated in a recent release. More information is available at https://aka.ms/dacfx-connection
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.
Time elapsed 0:00:16.30
In order to fix that, you need to add the "TargetTrustServerCertificate" and set it to Yes. Since we are using the sqlpackage here, therefore we have to add the parameter /ttsc:True. (See SqlPackage parameters here).
Your database import command will look like this:
SqlPackage.exe /a:import /sf:C:\Users\Admin7f04592810\Downloads\uatbackup.bacpac /tsn:localhost /tdn:AxDB_fromProd /p:CommandTimeout=50000 /ttsc:True

Comments
Post a Comment