Skip to content

Commit e210210

Browse files
authored
Merge pull request #9109 from FonsecaSergio/patch-5
Update Set-AzSqlServerAuditing.md
2 parents 1ace19d + 4d4a2c4 commit e210210

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Sql/Sql/help/Set-AzSqlServerAuditing.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,18 @@ PS C:\>Set-AzSqlServerAuditing -State Enabled -ResourceGroupName "ResourceGroup0
117117

118118
### Example 6: Enable the event hub auditing policy of an Azure SQL server
119119
```
120-
PS C:\>Set-AzSqlServerAuditing -State Enabled -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -EventHubName "EventHubName" -EventHubAuthorizationRuleResourceId "EventHubAuthorizationRuleResourceId"
120+
$EventHubAuthorizationRule = Get-AzEventHubAuthorizationRule `
121+
-ResourceGroupName "ResourceGroup01" `
122+
-Namespace "EventHubName" `
123+
-Name "SharedAccessPoliceName"
124+
125+
Set-AzSqlServerAuditing `
126+
-State Enabled `
127+
-ResourceGroupName "ResourceGroup01" `
128+
-ServerName "Server01" `
129+
-EventHub `
130+
-EventHubName "EventHubName" `
131+
-EventHubAuthorizationRuleResourceId $EventHubAuthorizationRule.Id
121132
```
122133

123134
### Example 7: Disable the event hub auditing policy of an Azure SQL server

0 commit comments

Comments
 (0)