2

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: enter image description here


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.

enter image description here enter image description here

Adham Enaya
  • 780
  • 1
  • 11
  • 29

1 Answers1

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:

enter image description 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'
Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107
  • Thank you. When I get this error, what does it mean? The term '/p:BlockOnPossibleDataLoss=True' 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. – Adham Enaya May 07 '20 at 09:45
  • First if you want to progress withj your deployments it must be `false`. However it will delete some data. If you set true you will get what you have actually (true is a default behavior). This is a safe check so you need to first check if data wich are going to be deleted should be deleted. Do you use yaml od classic edit? Can you edit your question and show your task? – Krzysztof Madej May 07 '20 at 10:05
  • But now you have an issue with `/p:IgnoreColumnOrder`. I don't see in your options `/p:BlockOnPossibleDataLoss`. – Krzysztof Madej May 07 '20 at 10:19
  • the same for /p:BlockOnPossibleDataLoss – Adham Enaya May 07 '20 at 10:20
  • maybe something related to the SqlPackage installations on the deployment machine? – Adham Enaya May 07 '20 at 10:38
  • 1
    Please put all of them in one line. You break the line and it could be this. – Krzysztof Madej May 07 '20 at 10:40