1

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

  • 不要丢弃凭据
  • 不要删除数据库角色
  • 不要删除数据库范围的凭据
  • 不要放弃登录
  • 不要放弃权限
  • 不要放弃角色成员资格
  • 不要放弃用户
  • 不要删除服务器角色成员资格

不过,我在 CD SQL Deploy 中收到以下错误: 在此处输入图像描述


根据 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.

在此处输入图像描述 在此处输入图像描述

4

1 回答 1

1

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'
于 2020-05-07T08:25:43.427 回答