last sync: 2025-Aug-20 17:22:59 UTC

SQL Server Auditing Settings must log to specified Workspace

Community Policy definition

Source Repository Community-Policy GitHub
JSON Community-Policy GitHub
Deploy policy 2372a6b7-9b11-4d33-8d7b-38930308b451 (1.0.0) to Azure
Display name SQL Server Auditing Settings must log to specified Workspace
Id 2372a6b7-9b11-4d33-8d7b-38930308b451
Version 1.0.0
Details on versioning
Category SQL
Microsoft Learn
Description This compliments an existing built-in Policy: https://github.com/Azure/azure-policy/blob/master/built-in-policies/policyDefinitions/SQL/DataConnectosSqServerLogs_PolicyAssignment.json. This Policy is designed to detect if the Workspace configured for your audit settings has been changed and if so, change them back.
Mode Indexed
Type Custom Community
Effect Default
DeployIfNotExists
Allowed
DeployIfNotExists, AuditIfNotExists, Disabled
RBAC role(s)
Role Name Role Id
Monitoring Contributor 749f88d5-cbae-40b8-bcfc-e573ddc772fa
Log Analytics Contributor 92aaf0da-9dab-42b6-94a3-d43ce8d16293
Rule aliases THEN-ExistenceCondition (4)
Alias Namespace ResourceType Path PathIsDefault DefaultPath Modifiable
Microsoft.Insights/diagnosticSettings/logs[*] microsoft.insights diagnosticSettings properties.logs[*] True False
Microsoft.Insights/diagnosticSettings/logs[*].category microsoft.insights diagnosticSettings properties.logs[*].category True False
Microsoft.Insights/diagnosticSettings/logs[*].enabled microsoft.insights diagnosticSettings properties.logs[*].enabled True False
Microsoft.Insights/diagnosticSettings/workspaceId microsoft.insights diagnosticSettings properties.workspaceId True False
Rule resource types IF (1)
Microsoft.Sql/servers/databases
JSON
EPAC
Deploy policy 2372a6b7-9b11-4d33-8d7b-38930308b451 (1.0.0) to Azure