Invoke-DbaDbDataMasking not honoring "Persisted" property value on config file
Report
After generating a DataMaskingConfig file we can edit it to change some property values. I was recently playing with the Deterministic property, which uses the same masked value on all matches.
Assume I have the persisted property of the JSON config file with the value of "true".
- When my config has just one column, the persisted value is honoured, and the values being masked are equal. ✔️
- IF my config file has 2 columns (both with the persisted property set to
true, none of them is honoured. ❌
Host used
- [x] powershell.exe
- [x] VS Code
Errors Received
No errors.
Steps to Reproduce
- Generate a new config with 2 columns
New-DbaDbMaskingConfig -SqlInstance localhost -Database AdventureWorksLT2016 -Table Address -Column City, PostalCode -Path "d:\temp"
- Edit the generated configuration file and change the persisted property to
trueon both occurrences. - Use the saved config file on
Invoke-DbaDbDataMasking
Invoke-DbaDbDataMasking -SqlInstance localhost -Database AdventureWorksLT2016 -FilePath "D:\temp\localhost.AdventureWorksLT2016.DataMaskingConfig.json"
Expected Behavior
Anonymized values should be equal when values were equal before.
Actual Behavior
Each record is getting a value.

Environmental information
PowerShell Version : 5.1.19041.1023 dbatools latest installed : 1.0.168 Culture of OS : en-US
SQL Server:
Microsoft SQL Server 2016
us_english
@sanderstad do you have time to take a look? Thanks!
@ClaudioESSilva Can you include the config you're using? I have a little trouble with my docker installation so I can't really run the command to get the config
Sorry for the delay @sanderstad
Here is the example I'm trying to use.
{
"Name": "AdventureWorksLT2016",
"Type": "DataMaskingConfiguration",
"Tables": [
{
"Name": "Address",
"Schema": "SalesLT",
"Columns": [
{
"Name": "City",
"ColumnType": "nvarchar",
"CharacterString": null,
"MinValue": 15,
"MaxValue": 30,
"MaskingType": "Address",
"SubType": "City",
"Format": null,
"Separator": null,
"Deterministic": true,
"Nullable": false,
"KeepNull": true,
"Composite": null,
"Action": null,
"StaticValue": null
},
{
"Name": "PostalCode",
"ColumnType": "nvarchar",
"CharacterString": null,
"MinValue": 8,
"MaxValue": 15,
"MaskingType": "Address",
"SubType": "Zipcode",
"Format": null,
"Separator": null,
"Deterministic": true,
"Nullable": false,
"KeepNull": true,
"Composite": null,
"Action": null,
"StaticValue": null
}
],
"HasUniqueIndex": true,
"FilterQuery": null
}
]
}
🚧🚨 This issue is being marked as stale due to 90 days of inactivity. If you would like this issue to remain open:
- Verify the issue/bug is reproduced in the latest version of the module
- Verify the environmental info provided is still accurate
- Add any additional steps you followed to reproduce if necessary 🚨🚧 ⌛️ This issue will be closed in 30 days ⌛️
This got a bit stale. So let me bring this issue to you attention again...