从 Azure DevOps 部署 SQL 数据库时出现问题

问题描述 投票:0回答:1

我正在尝试使用 Azure Devops 将 SQL 数据库发布到我的本地 SQL 服务器。以下是错误:

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

我已经安装了 SQLPackage.exe 版本 16.1.6374

谢谢

sql sql-server azure-devops dacpac
1个回答
0
投票

我最近也遇到了同样的错误。经过多次尝试和尝试多种组合后,我找到了一种方法,可以在 DevOps 发布管道的 SQL Server 数据库部署任务中传递附加参数,将加密连接属性设置为 false,如下所示:

-EncryptConnection:0

下面也附上管道的屏幕截图:

© www.soinside.com 2019 - 2024. All rights reserved.