无法在 Azure DevOps CD 上部署 DacPac

Can't deploy DacPac on Azure DevOps CD

我正在使用 Visual Studio 从数据库项目构建 DacPac 文件。此外,在 Advanced Build Settings 的调试 Drop 选项卡中,我启用了以下选项:

仍然,我在 CD SQL 部署中收到以下错误:


编辑 根据 Krzysztof Madej 的建议,我提出了以下附加论点(他们正在处理另一个项目),但是对于论点,他提出了,对于这些论点,我得到了这个错误:

is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

AdditionalArgument中你必须添加

 /p:BlockOnPossibleDataLoss=false

但请注意,这会删除您的数据。

如果您使用经典版本,它将在此处:

在 yaml 中

- task: SqlAzureDacpacDeployment@1
  displayName: Execute Azure SQL : DacpacTask
  inputs:
    azureSubscription: '<Azure service connection>'
    ServerName: '<Database server name>'
    DatabaseName: '<Database name>'
    SqlUsername: '<SQL user name>'
    SqlPassword: '<SQL user password>'
    DacpacFile: '<Location of Dacpac file in $(Build.SourcesDirectory) after compilation>'
    additionalArguments: '/p:BlockOnPossibleDataLoss=false'