microsoft / DacFx

DacFx, SqlPackage, and other SQL development libraries enable declarative database development and database portability across SQL versions and environments. Share feedback here on dacpacs, bacpacs, and SQL projects.
https://aka.ms/sqlpackage-ref
MIT License
347 stars 20 forks source link

DoNotDropExtendedProperties=True not working in sqlpackage.exe #139

Open abhi421 opened 2 years ago

abhi421 commented 2 years ago

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)

chadbaldwin commented 2 years ago

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.

abhi421 commented 2 years ago

@chadbaldwin thanks `True

False` this setting work for me but definitely it's a bug in UI
Benjin commented 2 years ago

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.