Can't deploy DacPac on Azure DevOps CD

删除回忆录丶 提交于 2020-05-15 21:47:06

问题


I am building DacPac file from a database project using Visual Studio. Also, in the Debug Drop tab in Advanced Build Settings, I enabled the following options:

  • Do not drop credentials
  • Do not drop database roles
  • Do not drop database scoped credentials
  • Do not drop logins
  • Do not drop permissions
  • Do not drop role membership
  • Do not drop users
  • Do not drop server role membership

Still, I get the following error in CD SQL Deploy:


EDIT based on the advice of Krzysztof Madej, I have put the following additional arguments (they were working on another project), but for the argument, he proposed and for these ones I got this error:

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.


回答1:


In AdditionalArgument you have to add

 /p:BlockOnPossibleDataLoss=false

But be aware that will delete you data.

If you use classic release it will be here:

in 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'


来源:https://stackoverflow.com/questions/61650390/cant-deploy-dacpac-on-azure-devops-cd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!