无法在 Azure DevOps CD 上部署 DacPac。

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

我正在建设 DacPac 文件,使用Visual Studio从数据库项目中提取。另外,在Debug Drop 标签 Advanced Build Settings我启用了以下选项。

  • {fnMicrosoftYaHeifs17bord0shad0b0}我启用了以下选项 {fnMSReferenceSansSeriffs13bord0shad0b0}Ienabledthe following options: Do not drop credentials
  • 不要放弃数据库角色
  • 不要放弃数据库范围内的凭证
  • 不要放弃登录
  • 不要放弃权限
  • 不要放弃角色成员资格
  • 不要放弃用户
  • 不要放弃服务器角色成员资格

但在CD SQL Deploy中,我还是得到了以下错误。enter image description here


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

enter image description hereenter image description here

visual-studio azure-devops sql-server-data-tools dacpac ssdt-2017
1个回答
0
投票

AdditionalArgument 你必须加上

 /p:BlockOnPossibleDataLoss=false

但要注意,这将删除你的数据。

如果你使用经典版本,它将在这里。

enter image description here

在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'
© www.soinside.com 2019 - 2024. All rights reserved.