Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Dacpac Deploy using SqlPackage and DropObjectsNotInSource with DoNotDropUsers

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?

like image 313
Hungry Beast Avatar asked Sep 25 '22 10:09

Hungry Beast


1 Answers

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
like image 141
Steven Green Avatar answered Sep 28 '22 06:09

Steven Green