Skip to content

Commit

Permalink
Update Set-AzSqlDatabaseVulnerabilityAssessmentRuleBaseline.md (#14432)
Browse files Browse the repository at this point in the history
The default powershell array does not parse the values correctly when there is a single array , However it works fine when there are multiple arrays. 
The workaround would be to not use the default array and use [System.Collections.ArrayList] as mentioned in here #12092.
Please update the documentation , we have customers wondering why this command is not working on single array. 
I have added the script above as well in Example 1.
  • Loading branch information
sbojjawar-Msft authored Mar 5, 2021
1 parent 9a7a164 commit 5957b6f
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,22 @@ Note that you need to run *Enable-AzSqlServerAdvancedDataSecurity* and *Update-A

### Example 1: Set a vulnerability assessment rule baseline
```powershell
PS C:\> Set-AzSqlDatabaseVulnerabilityAssessmentRuleBaseline `
PS C:\> $arrayList = [System.Collections.ArrayList]::new()
$arrayList.Add(@('dbo', 'db_owner', 'SQL_USER', 'INSTANCE'))
Set-AzSqlDatabaseVulnerabilityAssessmentRuleBaseline `
-ResourceGroupName "demoresourcegroup" `
-ServerName "demosqlser" `
-DatabaseName "SQL_ERConnect" `
-BaselineResult $arrayList `
-RuleID 'VA2108'
Rule ID Rule Applies To Master Baseline Results
------- ---------------------- ----------------
VA2108 False {dbo;db_owner;SQL_USER;INSTANCE}
Set-AzSqlDatabaseVulnerabilityAssessmentRuleBaseline `
-ResourceGroupName "ResourceGroup01" `
-ServerName "Server01" `
-DatabaseName "Database01" `
Expand Down

0 comments on commit 5957b6f

Please sign in to comment.