Open asrichesson opened 4 months ago
@skpadhy33 this seems like an AE issue, can your team take a look? Thanks.
Hi,
Unless the property '/p:DropObjectsNotInSource
' is not set to $true
, the deployment using SqlPackage does not attempt to drop the CEK(s) and CMK(s).
Hence the following command does not throw the error:
.\SqlPackage /Action:Publish /SourceFile:$dacpacPath /TargetConnectionString:$connStr /DiagnosticsFile:$logFilePath
But, the following ccommand reproduces the issue, which we are looking into:
.\SqlPackage /Action:Publish /SourceFile:$dacpacPath /TargetConnectionString:$connStr /DiagnosticsFile:$logFilePath /p:DropObjectsNotInSource=True
I understand that the aim is not to simply decrypt the column but also drop the CEK and CMK in the target database by publishing the dacpac. In that case, there is a simple workaround to achieve this.
/p:DropObjectsNotInSource
' as follows. This decrypts the encrypted column but does not drop the CEK and CMK.
.\SqlPackage /Action:Publish /SourceFile:$dacpacPath /TargetConnectionString:$connStr /DiagnosticsFile:$logFilePath
/p:DropObjectsNotInSource
' specified as $true
as follows. This will successfully drop the CEK and the CMK.
.\SqlPackage /Action:Publish /SourceFile:$dacpacPath /TargetConnectionString:$connStr /DiagnosticsFile:$logFilePath /p:DropObjectsNotInSource=True
@asrichesson , hope this helps if not tried already. We are looking into this issue and let you know for any updates.
Thanks.
Steps to Reproduce:
Example script:
Did this occur in prior versions? If not - which version(s) did it work in?
(DacFx/SqlPackage/SSMS/Azure Data Studio)