5

I am running SqlPackage in my CI build to deploy dacpacs and pass in a publish.xml file using the /Profile switch. I have the following three options set in the profile:

<DropObjectsNotInSource>True</DropObjectsNotInSource>
<DoNotDropPermissions>True</DoNotDropPermissions>
<DoNotDropUsers>True</DoNotDropUsers>

However when I run the dacpac deploy it still tries to drop my users. Any ideas?

Hungry Beast
  • 3,677
  • 7
  • 49
  • 75

2 Answers2

3

There is (unfortunately) a bug in SqlPackage.exe's handling of publish profiles, whereby the DoNotDrop and Exclude options are not honored. This will be fixed in an upcoming version of SqlPackage.exe. In the meantime have you tried using this SqlPackage.exe command line argument?

/p:DoNotDropObjectTypes=Permissions;Users
Steven Green
  • 3,387
  • 14
  • 17
  • Do you have a reference to a MS Connect or other similar acknowledgment of this bug from the gods at Microsoft? – Derek Evermore Apr 21 '16 at 18:38
  • 3
    There's a statement regarding this having been fixed in SqlPackage.exe on the SSDT team blog: https://blogs.msdn.microsoft.com/ssdt/2016/04/15/sql-server-data-tools-preview-update-for-april-2016/ – Steven Green Apr 21 '16 at 21:01
1

Check the timestamp and version on your SqlPackage.exe. You may be calling the wrong one.

The one that will honor the DoNotDrop and Exclude options should be stamped 7/30/2015 3:04AM, versioned 12.0.3021.1 and be located here: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120

The other one (which does not honor these settings) is stamped 3/28/2014 10:56pm, versioned 12.0.1294.0 and is at C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin

Derek Evermore
  • 1,418
  • 1
  • 10
  • 22