JSON compareHide
compare mode:
side-by-side
line-by-line
version left: 1.1.0
version right: 1.2.0 1.1.0
@@ -3,9 +3,9 @@
3
"policyType": "BuiltIn",
4
"mode": "Indexed",
5
"description": "Deploys the diagnostic settings for Azure SQL Database to stream to a regional Event Hub on any Azure SQL Database which is missing this diagnostic settings is created or updated.",
6
"metadata": {
7
-
"version": "1.1.0",
8
"category": "SQL"
9
},
10
"parameters": {
11
"profileName": {
@@ -62,13 +62,13 @@
62
"name": "[parameters('profileName')]",
63
"existenceCondition": {
64
"allOf": [
65
{
66
-
"field": "Microsoft.Insights/diagnosticSettings/logs.enabled",
67
"equals": "[parameters('logsEnabled')]"
68
},
69
{
70
-
"field": "Microsoft.Insights/diagnosticSettings/metrics.enabled",
71
"equals": "[parameters('metricsEnabled')]"
72
}
73
]
74
},
@@ -159,8 +159,12 @@
159
},
160
{
161
"category": "Deadlocks",
162
"enabled": "[parameters('logsEnabled')]"
163
}
164
]
165
}
166
}
3
"policyType": "BuiltIn",
4
"mode": "Indexed",
5
"description": "Deploys the diagnostic settings for Azure SQL Database to stream to a regional Event Hub on any Azure SQL Database which is missing this diagnostic settings is created or updated.",
6
"metadata": {
7
+
"version": "1.2 .0",
8
"category": "SQL"
9
},
10
"parameters": {
11
"profileName": {
62
"name": "[parameters('profileName')]",
63
"existenceCondition": {
64
"allOf": [
65
{
66
+
"field": "Microsoft.Insights/diagnosticSettings/logs[*] .enabled",
67
"equals": "[parameters('logsEnabled')]"
68
},
69
{
70
+
"field": "Microsoft.Insights/diagnosticSettings/metrics[*] .enabled",
71
"equals": "[parameters('metricsEnabled')]"
72
}
73
]
74
},
159
},
160
{
161
"category": "Deadlocks",
162
"enabled": "[parameters('logsEnabled')]"
163
+
},
164
+
{
165
+
"category": "DevOpsOperationsAudit",
166
+
"enabled": "[parameters('logsEnabled')]"
167
}
168
]
169
}
170
}
JSON
api-version=2021-06-01
Copy definition Copy definition 4 EPAC EPAC
{ 7 items displayName: "Deploy Diagnostic Settings for Azure SQL Database to Event Hub" , policyType: "BuiltIn" , mode: "Indexed" , description: "Deploys the diagnostic settings for Azure SQL Database to stream to a regional Event Hub on any Azure SQL Database which is missing this diagnostic settings is created or updated." , metadata: { 2 items version: "1.2.0" , category: "SQL" } , parameters: { 4 items profileName: { 3 items type: "String" , metadata: { 2 items displayName: "Profile name" , description: "The diagnostic settings profile name" } , defaultValue: "setbypolicy" } , eventHubRuleId: { 2 items type: "String" , metadata: { 4 items displayName: "Event Hub Authorization Rule Id" , description: "The Event Hub authorization rule Id for Azure Diagnostics. The authorization rule needs to be at Event Hub namespace level. e.g. /subscriptions/{subscription Id}/resourceGroups/{resource group}/providers/Microsoft.EventHub/namespaces/{Event Hub namespace}/authorizationrules/{authorization rule}" , strongType: "Microsoft.EventHub/Namespaces/AuthorizationRules" , assignPermissions: true } } , metricsEnabled: { 4 items } , logsEnabled: { 4 items } } , policyRule: { 2 items if: { 2 items field: "type" , equals: "Microsoft.Sql/servers/databases" } , then: { 2 items effect: "DeployIfNotExists" , details: { 5 items type: "Microsoft.Insights/diagnosticSettings" , name: "[parameters('profileName')]" , existenceCondition: { 1 item allOf: [ 2 items { 2 items field: "Microsoft.Insights/diagnosticSettings/logs[*].enabled" , equals: "[parameters('logsEnabled')]" } , { 2 items field: "Microsoft.Insights/diagnosticSettings/metrics[*].enabled" , equals: "[parameters('metricsEnabled')]" } ] } , roleDefinitionIds: [ 1 item "/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c" Contributor ] , deployment: { 1 item properties: { 3 items mode: "incremental" , template: { 5 items $schema: "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" , contentVersion: "1.0.0.0" , parameters: { 6 items } , resources: [ 1 item { 6 items type: "Microsoft.Sql/servers/databases/providers/diagnosticSettings" , apiVersion: "2017-05-01-preview" , name: 🔍 "[
concat(
parameters('fullName'),
'/',
'Microsoft.Insights/',
parameters('profileName')
)
]", location: "[parameters('location')]" , dependsOn : [] , properties: { 3 items eventHubAuthorizationRuleId: "[parameters('eventHubRuleId')]" , metrics: [ 1 item ] , logs: [ 11 items { 2 items category: "QueryStoreRuntimeStatistics" , enabled: "[parameters('logsEnabled')]" } , { 2 items category: "QueryStoreWaitStatistics" , enabled: "[parameters('logsEnabled')]" } , { 2 items category: "Errors" , enabled: "[parameters('logsEnabled')]" } , { 2 items category: "DatabaseWaitStatistics" , enabled: "[parameters('logsEnabled')]" } , { 2 items category: "Blocks" , enabled: "[parameters('logsEnabled')]" } , { 2 items category: "SQLInsights" , enabled: "[parameters('logsEnabled')]" } , { 2 items category: "SQLSecurityAuditEvents" , enabled: "[parameters('logsEnabled')]" } , { 2 items category: "Timeouts" , enabled: "[parameters('logsEnabled')]" } , { 2 items category: "AutomaticTuning" , enabled: "[parameters('logsEnabled')]" } , { 2 items category: "Deadlocks" , enabled: "[parameters('logsEnabled')]" } , { 2 items category: "DevOpsOperationsAudit" , enabled: "[parameters('logsEnabled')]" } ] } } ] , outputs: { 1 item policy: { 2 items type: "string" , value: 🔍 "[
concat(
'Enabled diagnostic settings for',
parameters('fullName')
)
]" } } } , parameters: { 6 items } } } } } } }