【发布时间】:2021-01-25 02:14:59
【问题描述】:
我正在使用通过 Azure DevOps Pipelines 部署的 Azure SQL DB 刷新 CI/CD 流程。我正在使用 Adventure 作品数据库并设置了一个导入架构的 Visual Studio 项目。
我有一个配置为发布 dacpac 并使用 SqlAzureDacpacDeployment@1 运行后续部署的管道,并且收到以下错误:
2020-10-10T02:36:34.1421137Z ##[error]Unable to connect to target server 'server.database.windows.net'. Please verify the connection information such as the server name, login credentials, and firewall rules for the target server.
2020-10-10T02:36:34.1605855Z ##[error]Windows logins are not supported in this version of SQL Server.
2020-10-10T02:36:34.2143924Z ##[error]The Azure SQL DACPAC task failed. SqlPackage.exe exited with code 1.Check out how to troubleshoot failures at https://aka.ms/sqlazuredeployreadme#troubleshooting-
2020-10-10T02:36:34.2522414Z ##[section]Finishing: SqlAzureDacpacDeployment
我正在使用最新的 Windows,这是我的 YAML 管道:
trigger:
- master
pool:
vmImage: 'windows-latest'
jobs:
- job: BuildDeploySQL
variables:
- group: SQLServerLogin
steps:
- task: VSBuild@1
inputs:
solution: '**\*.sln'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)'
publishLocation: 'pipeline'
- task: SqlAzureDacpacDeployment@1
inputs:
azureSubscription: 'Subscription Name here'
AuthenticationType: 'server'
ServerName: 'server.database.windows.net'
DatabaseName: 'AdventureWorks'
SqlUsername: 'sqladmin'
SqlPassword: ${{ variables.Password }}
deployType: 'DacpacTask'
DeploymentAction: 'Publish'
DacpacFile: '$(Pipeline.Workspace)\s\AdventureWorks\bin\Debug\*.dacpac'
IpDetectionMethod: 'AutoDetect'
我尝试从我的本地计算机进行部署,并且使用相同的 sql 凭据成功。此外,我已确认 SQL 数据库已启用 Azure 服务。我还尝试将 dacpac 部署到一个新的空数据库并得到同样的错误。
我确实认为这可能只是一般错误消息,因为我的部署日志确实显示成功连接到服务器:
2020-10-10T02:36:18.7912964Z Invoke-Sqlcmd -ServerInstance "server.database.windows.net" -Database "AdventureWorks" -Username "sqladmin" -Password ****** -Inputfile
....
2020-10-10T02:36:33.0554895Z Initializing deployment (Start)
** 更新 只是为了排除我确实创建了一个具有 DBO_owner 权限的新 SQL 登录并使用它运行部署并得到了相同的错误消息。
【问题讨论】:
标签: azure azure-devops azure-sql-database azure-pipelines dac