0

I am trying to release SQL Database to my on-premise SQL server using Azure Devops. Below is the error:

2022-11-18T17:37:44.0988600Z ##[section]Starting: SQL DB Deploy
2022-11-18T17:37:44.1275271Z 
=====================================================================
2022-11-18T17:37:44.1276412Z Task         : SQL Server database deploy
2022-11-18T17:37:44.1277423Z Description  : Deploy a SQL Server database using DACPAC or SQL scripts
2022-11-18T17:37:44.1278258Z Version      : 0.198.0
2022-11-18T17:37:44.1278915Z Author       : Microsoft Corporation
2022-11-18T17:37:44.1280125Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/sql-dacpac-deployment-on-machine-group
2022-11-18T17:37:44.1281650Z ==============================================================================
2022-11-18T17:37:52.3600701Z *** Could not deploy package.
2022-11-18T17:37:52.3605929Z Changes to connection setting default values were incorporated in a recent release.  More information is available at https://aka.ms/dacfx-connection
2022-11-18T17:37:52.3609312Z Unable to connect to target server 'WIN-SERVER1-LAR'. Please verify the connection information such as the server name, login credentials, and firewall rules for the target server.
2022-11-18T17:37:52.3613093Z 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.)
2022-11-18T17:37:52.3616194Z The certificate chain was issued by an authority that is not trusted
2022-11-18T17:37:52.7425545Z ##[error]Publishing to database 'MarketplaceDev' on server 'WIN-SERVER1-LAR'. 
Initializing deployment (Start) 
Initializing deployment (Failed) 
*** Changes to connection setting default values were incorporated in a recent release.  More information is available at https://aka.ms/dacfx-connection 
*** 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:02.71 

2022-11-18T17:37:52.7816299Z ##[section]Finishing: SQL DB Deploy

I already installed SQLPackage.exe version 16.1.6374

Thanks

delphiman
  • 25
  • 6
  • The piece of the error that actually matters here is _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.)_ – Nick.Mc Nov 18 '22 at 23:30
  • Here are some suggestions for changes you can make to your connection string to make it work https://stackoverflow.com/questions/17615260/the-certificate-chain-was-issued-by-an-authority-that-is-not-trusted-when-conn – Nick.Mc Nov 18 '22 at 23:31
  • In fact if you had taken the time to read the link provided in the error message you would find more detailed information there https://techcommunity.microsoft.com/t5/azure-sql-blog/connection-security-improvements-in-sqlpackage-161/ba-p/3672758 – Nick.Mc Nov 18 '22 at 23:34

1 Answers1

0

I have been facing the same error lately. After multiple attempts and trying several combinations, I was able to figure out a way by which we can pass an additional arguement in the SQL Server Database Deploy task in DevOps Release pipeline to have the encrypt connection property set to false same as below:

-EncryptConnection:0

Attaching a screenshot of the pipeline too below:

enter image description here

Manish
  • 36
  • 1
  • 5