DacFx icon indicating copy to clipboard operation
DacFx copied to clipboard

DoNotDropExtendedProperties=True not working in sqlpackage.exe

Open abhi421 opened this issue 3 years ago • 3 comments

  • SqlPackage or DacFx Version:
  • .NET Framework (Windows-only) or .NET Core:
  • Environment (local platform and source/target platforms):

Steps to Reproduce: I have this properties when I save the publish profile in visual studio image

image

but it drop the extended properties when I publish the profile locally from visual studio.

and when I tried to publish the same profile with azure pipeline got this error in my release pipeline

image

(DacFx/SqlPackage/SSMS/Azure Data Studio)

abhi421 avatar Sep 02 '22 14:09 abhi421

After playing around with turning check boxes on and off, and saving the publish profile. It seems it is possible to end up with both of these set:

<DoNotDropExtendedProperties>True</DoNotDropExtendedProperties>
<DropExtendedPropertiesNotInSource>True</DropExtendedPropertiesNotInSource>

To fix this using the UI, you can uncheck Drop objects in target but not in source at the top, then uncheck Drop extended properties not in source in the section below the scroll box, then re-check Drop objects in target but not in source at the top. Then hit save. This should remove the conflict.

Or to fix it manually, you could remove the DropExtendedPropertiesNotInSource element from your publish profile XML file.

This does seem like a bug...maybe. The UI should know there is a link between Do not drop extended properties and Drop extended properties not in source and should set them accordingly based on the UI.

chadbaldwin avatar Sep 02 '22 17:09 chadbaldwin

@chadbaldwin thanks <DoNotDropExtendedProperties>True</DoNotDropExtendedProperties> <DropExtendedPropertiesNotInSource>False</DropExtendedPropertiesNotInSource> this setting work for me but definitely it's a bug in UI

abhi421 avatar Sep 03 '22 08:09 abhi421

Thanks for reporting this, @abhi421! DacFx has many options, and it seems we've missed a restriction on this particular combination. As the UI is over in SSDT, I'll bring attention to this issue to that team.

Benjin avatar Sep 09 '22 16:09 Benjin