diff --git a/patterns/alz/alzArm.json b/patterns/alz/alzArm.json index 251e4fb90..21bdd80fa 100644 --- a/patterns/alz/alzArm.json +++ b/patterns/alz/alzArm.json @@ -339,6 +339,27 @@ "description": "Provide the alert processing rule used for monitoring." } }, + "ALZAlertSeverity": { + "type": "array", + "defaultValue": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ], + "metadata": { + "description": "Alert Severities for alert processing rule to action." + } + }, + "ALZNotificationAssetSuffix" :{ + + "type": "string", + "defaultValue": "-001", + "metadata": { + "description": "Suffix for the notification assets." + } + }, "currentDateTimeUtcNow": { "type": "string", "defaultValue": "[utcNow()]", @@ -487,12 +508,20 @@ "value": "[parameters('BYOAlertProcessingRule')]" } }, + "notificationAssetSeverityParameters": { + "ALZAlertSeverity": { + "value": "[parameters('ALZAlertSeverity')]" + }, + "ALZNotificationAssetSuffix": { + "value": "[parameters('ALZNotificationAssetSuffix')]" + } + }, // Declaring the policy assignment parameters that will be used for all policy assignments "policyAssignmentParametersConnectivity": "[union(variables('policyAssignmentParametersCommon'), parameters('policyAssignmentParametersConnectivity'))]", "policyAssignmentParametersIdentity": "[union(variables('policyAssignmentParametersCommon'), parameters('policyAssignmentParametersIdentity'))]", "policyAssignmentParametersManagement": "[union(variables('policyAssignmentParametersCommon'), parameters('policyAssignmentParametersManagement'), variables('uamiParameters'))]", "policyAssignmentParametersServiceHealth": "[union(variables('policyAssignmentParametersCommon'), parameters('policyAssignmentParametersServiceHealth'), variables('notificationAssetParameters'))]", - "policyAssignmentParametersNotificationAssets": "[union(variables('policyAssignmentParametersCommon'), variables('notificationAssetParameters'))]", + "policyAssignmentParametersNotificationAssets": "[union(variables('policyAssignmentParametersCommon'), variables('notificationAssetParameters'), variables('notificationAssetSeverityParameters'))]", "policyAssignmentParametersHybridVM": "[union(variables('policyAssignmentParametersCommon'), parameters('policyAssignmentParametersHybridVM'), variables('uamiParameters'))]", "policyAssignmentParametersKeyManagement": "[union(variables('policyAssignmentParametersCommon'), parameters('policyAssignmentParametersKeyManagement'))]", "policyAssignmentParametersLoadBalancing": "[union(variables('policyAssignmentParametersMonitorDisable'), parameters('policyAssignmentParametersLoadBalancing'))]", diff --git a/patterns/alz/alzArm.param.json b/patterns/alz/alzArm.param.json index 809427c2d..8926fdac0 100644 --- a/patterns/alz/alzArm.param.json +++ b/patterns/alz/alzArm.param.json @@ -120,6 +120,18 @@ "ALZFunctionTriggerUrl": { "value": "" }, + "ALZNotificationAssetSuffix": { + "value": "-001" + }, + "ALZAlertSeverity": { + "value": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ] + }, "BYOActionGroup": { "value": [] }, diff --git a/patterns/alz/eslzArm.terraform-sync.param.json b/patterns/alz/eslzArm.terraform-sync.param.json index b115e9a8a..6d239081b 100644 --- a/patterns/alz/eslzArm.terraform-sync.param.json +++ b/patterns/alz/eslzArm.terraform-sync.param.json @@ -120,6 +120,18 @@ "ALZFunctionTriggerUrl": { "value": "" }, + "ALZNotificationAssetSuffix": { + "value": "-001" + }, + "ALZAlertSeverity": { + "value": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ] + }, "BYOActionGroup": { "value": [] }, diff --git a/patterns/alz/policyDefinitions/policies-Network.json b/patterns/alz/policyDefinitions/policies-Network.json index 9c109936b..2ed740e3b 100644 --- a/patterns/alz/policyDefinitions/policies-Network.json +++ b/patterns/alz/policyDefinitions/policies-Network.json @@ -8249,4 +8249,4 @@ } } } -} \ No newline at end of file +} diff --git a/patterns/alz/policyDefinitions/policies-NotificationAssets.json b/patterns/alz/policyDefinitions/policies-NotificationAssets.json index 7694146d2..eb7a6b637 100644 --- a/patterns/alz/policyDefinitions/policies-NotificationAssets.json +++ b/patterns/alz/policyDefinitions/policies-NotificationAssets.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.32.4.45862", - "templateHash": "13822163595010851058" + "templateHash": "15718771503471817894" } }, "parameters": { @@ -115,8 +115,8 @@ "input": "[json(variables('processPolicySetDefinitionsAzureUSGovernment')[copyIndex('policySetDefinitionsAzureUSGovernment')])]" } ], - "$fxv#0": "{\r\n \"type\": \"Microsoft.Authorization/policyDefinitions\",\r\n \"apiVersion\": \"2021-06-01\",\r\n \"name\": \"Deploy_AlertProcessing_Rule\",\r\n \"properties\": {\r\n \"policyType\": \"Custom\",\r\n \"mode\": \"All\",\r\n \"displayName\": \"Deploy AMBA Notification Assets\",\r\n \"description\": \"Policy to deploy Action Group and Alert Processing Rule for all AMBA alerts\",\r\n \"metadata\": {\r\n \"version\": \"1.4.0\",\r\n \"category\": \"Monitoring\",\r\n \"source\": \"https://github.com/Azure/azure-monitor-baseline-alerts/\",\r\n \"alzCloudEnvironments\": [\r\n \"AzureCloud\"\r\n ],\r\n \"_deployed_by_amba\": \"True\"\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Name\",\r\n \"description\": \"Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": \"rg-amba-monitoring-001\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"type\": \"Object\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Tags\",\r\n \"description\": \"Tags on the Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": {\r\n \"_deployed_by_amba\": true\r\n }\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Location\",\r\n \"description\": \"Location of the Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": \"centralus\"\r\n },\r\n \"ALZMonitorActionGroupEmail\": {\r\n \"type\": \"Array\",\r\n \"metadata\": {\r\n \"displayName\": \"Action Group Email Addresses\",\r\n \"description\": \"Email addresses to send alerts to\"\r\n },\r\n \"defaultValue\": []\r\n },\r\n \"ALZLogicappResourceId\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Logic App Resource Id\",\r\n \"description\": \"Logic App Resource Id for Action Group to send alerts to\"\r\n },\r\n \"defaultValue\": \"\"\r\n },\r\n \"ALZLogicappCallbackUrl\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Logic App Callback URL\",\r\n \"description\": \"Callback URL that triggers the Logic App\"\r\n },\r\n \"defaultValue\": \"\"\r\n },\r\n \"ALZArmRoleId\": {\r\n \"type\": \"array\",\r\n \"metadata\": {\r\n \"displayName\": \"Arm Role Ids\",\r\n \"description\": \"Arm Built-in Role Ids for action group to send alerts to\"\r\n },\r\n \"defaultValue\": []\r\n },\r\n \"ALZEventHubResourceId\": {\r\n \"type\": \"array\",\r\n \"metadata\": {\r\n \"displayName\": \"Event Hub resource Ids\",\r\n \"description\": \"Event Hub resource Ids for action group to send alerts to\"\r\n },\r\n \"defaultValue\": []\r\n },\r\n \"ALZWebhookServiceUri\": {\r\n \"type\": \"Array\",\r\n \"metadata\": {\r\n \"displayName\": \"Webhook Service Uri(s)\",\r\n \"description\": \"Indicates the service uri(s) of the webhook to send alerts to\"\r\n },\r\n \"defaultValue\": []\r\n },\r\n \"ALZFunctionResourceId\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Function Resource Id\",\r\n \"description\": \"Function Resource Id for Action Group to send alerts to\"\r\n },\r\n \"defaultValue\": \"\"\r\n },\r\n \"ALZFunctionTriggerUrl\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Function Trigger URL\",\r\n \"description\": \"URL that triggers the Function\"\r\n },\r\n \"defaultValue\": \"\"\r\n },\r\n \"BYOActionGroup\": {\r\n \"type\": \"array\",\r\n \"metadata\": {\r\n \"displayName\": \"Customer defined Action Group Resource IDs\",\r\n \"description\": \"The Resource IDs of existing Action Groups currently deployed in the environment.\"\r\n },\r\n \"defaultValue\": []\r\n },\r\n \"BYOAlertProcessingRule\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Customer defined Alert Processing Rule Resource ID\",\r\n \"description\": \"The Resource ID of an existing Alert Processing Rule already deployed by the customer in his environment\"\r\n },\r\n \"defaultValue\": \"\"\r\n },\r\n \"MonitorDisableTagName\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"ALZ Monitoring disabled tag name\",\r\n \"description\": \"Tag name to disable monitoring. Set to true if monitoring should be disabled\"\r\n },\r\n \"defaultValue\": \"MonitorDisable\"\r\n },\r\n \"MonitorDisableTagValues\": {\r\n \"type\": \"Array\",\r\n \"metadata\": {\r\n \"displayName\": \"ALZ Monitoring disabled tag values(s)\",\r\n \"description\": \"Tag value(s) used to disable monitoring at the resource level. Set to true if monitoring should be disabled.\"\r\n },\r\n \"defaultValue\": [\r\n \"true\",\r\n \"Test\",\r\n \"Dev\",\r\n \"Sandbox\"\r\n ]\r\n }\r\n },\r\n \"policyRule\": {\r\n \"if\": {\r\n \"allOf\": [\r\n {\r\n \"field\": \"type\",\r\n \"equals\": \"Microsoft.Resources/subscriptions\"\r\n },\r\n {\r\n \"field\": \"[[concat('tags[', parameters('MonitorDisableTagName'), ']')]\",\r\n \"notIn\": \"[[parameters('MonitorDisableTagValues')]\"\r\n },\r\n {\r\n \"value\": \"[[empty(parameters('BYOAlertProcessingRule'))]\",\r\n \"equals\": \"true\"\r\n }\r\n ]\r\n },\r\n \"then\": {\r\n \"effect\": \"deployIfNotExists\",\r\n \"details\": {\r\n \"roleDefinitionIds\": [\r\n \"/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c\"\r\n ],\r\n \"type\": \"Microsoft.AlertsManagement/actionRules\",\r\n \"existenceScope\": \"resourceGroup\",\r\n \"resourceGroupName\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"deploymentScope\": \"subscription\",\r\n \"existenceCondition\": {\r\n \"allOf\": [\r\n {\r\n \"field\": \"Microsoft.AlertsManagement/actionRules/description\",\r\n \"equals\": \"AMBA Notification Assets - Alert Processing Rule for Subscription\"\r\n }\r\n ]\r\n },\r\n \"deployment\": {\r\n \"location\": \"northeurope\",\r\n \"properties\": {\r\n \"mode\": \"incremental\",\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"type\": \"object\"\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZMonitorActionGroupEmail\": {\r\n \"type\": \"Array\"\r\n },\r\n \"ALZLogicappResourceId\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZLogicappCallbackUrl\": {\r\n \"type\": \"String\"\r\n },\r\n \"ALZArmRoleId\": {\r\n \"type\": \"array\"\r\n },\r\n \"ALZEventHubResourceId\": {\r\n \"type\": \"array\"\r\n },\r\n \"ALZWebhookServiceUri\": {\r\n \"type\": \"Array\"\r\n },\r\n \"ALZFunctionResourceId\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZFunctionTriggerUrl\": {\r\n \"type\": \"String\"\r\n },\r\n \"BYOActionGroup\": {\r\n \"type\": \"array\"\r\n },\r\n \"BYOAlertProcessingRule\": {\r\n \"type\": \"String\"\r\n }\r\n },\r\n \"variables\": {\r\n \"varBYOAlertProcessingRule\": \"[[if(empty(parameters('BYOAlertProcessingRule')), null(), trim(parameters('BYOAlertProcessingRule')))]\",\r\n \"varLogicAppReceivers\": [\r\n {\r\n \"name\": \"AlzLA-0\",\r\n \"resourceId\": \"[[if(empty(parameters('ALZLogicappResourceId')), null(), trim(parameters('ALZLogicappResourceId')))]\",\r\n \"callbackUrl\": \"[[if(empty(parameters('ALZLogicappCallbackUrl')), null(), trim(parameters('ALZLogicappCallbackUrl')))]\",\r\n \"useCommonAlertSchema\": true\r\n }\r\n ],\r\n \"varAzureFunctionReceivers\": [\r\n {\r\n \"name\": \"AlzFa-0\",\r\n \"functionAppResourceId\": \"[[if(empty(parameters('ALZFunctionResourceId')), null(), split(trim(parameters('ALZFunctionResourceId')),'/functions/')[0])]\",\r\n \"functionName\": \"[[if(empty(parameters('ALZFunctionResourceId')), null(), split(trim(parameters('ALZFunctionResourceId')),'/')[10])]\",\r\n \"httpTriggerUrl\": \"[[if(empty(parameters('ALZFunctionTriggerUrl')), null(), trim(parameters('ALZFunctionTriggerUrl')))]\",\r\n \"useCommonAlertSchema\": true\r\n }\r\n ],\r\n \"copy\": [\r\n {\r\n \"name\": \"varEmailReceivers\",\r\n \"count\": \"[[length(parameters('ALZMonitorActionGroupEmail'))]\",\r\n \"mode\": \"serial\",\r\n \"input\": {\r\n \"name\": \"[[concat('AlzMail-', indexOf(parameters('ALZMonitorActionGroupEmail'), parameters('ALZMonitorActionGroupEmail')[copyIndex('varEmailReceivers')]))]\",\r\n \"emailAddress\": \"[[trim(parameters('ALZMonitorActionGroupEmail')[copyIndex('varEmailReceivers')])]\",\r\n \"useCommonAlertSchema\": true\r\n }\r\n },\r\n {\r\n \"name\": \"varArmRoleReceivers\",\r\n \"count\": \"[[length(parameters('ALZArmRoleId'))]\",\r\n \"mode\": \"serial\",\r\n \"input\": {\r\n \"name\": \"[[concat('AlzARM-', indexOf(parameters('ALZArmRoleId'), parameters('ALZArmRoleId')[copyIndex('varArmRoleReceivers')]))]\",\r\n \"roleId\": \"[[trim(parameters('ALZArmRoleId')[copyIndex('varArmRoleReceivers')])]\",\r\n \"useCommonAlertSchema\": true\r\n }\r\n },\r\n {\r\n \"name\": \"varEventHubReceivers\",\r\n \"count\": \"[[length(parameters('ALZEventHubResourceId'))]\",\r\n \"mode\": \"serial\",\r\n \"input\": {\r\n \"name\": \"[[concat('AlzEH-', indexOf(parameters('ALZEventHubResourceId'), parameters('ALZEventHubResourceId')[copyIndex('varEventHubReceivers')]))]\",\r\n \"subscriptionId\": \"[[if(empty(parameters('ALZEventHubResourceId')), null(), split(trim(parameters('ALZEventHubResourceId')[copyIndex('varEventHubReceivers')]),'/')[2])]\",\r\n \"eventHubNameSpace\": \"[[if(empty(parameters('ALZEventHubResourceId')), null(), split(trim(parameters('ALZEventHubResourceId')[copyIndex('varEventHubReceivers')]),'/')[8])]\",\r\n \"eventHubName\": \"[[if(empty(parameters('ALZEventHubResourceId')), null(), split(trim(parameters('ALZEventHubResourceId')[copyIndex('varEventHubReceivers')]),'/')[10])]\",\r\n \"useCommonAlertSchema\": true,\r\n \"tenantId\": \"[[subscription().tenantId]\"\r\n }\r\n },\r\n {\r\n \"name\": \"varWebhookReceivers\",\r\n \"count\": \"[[length(parameters('ALZWebhookServiceUri'))]\",\r\n \"mode\": \"serial\",\r\n \"input\": {\r\n \"name\": \"[[concat('AlzWh-', indexOf(parameters('ALZWebhookServiceUri'), parameters('ALZWebhookServiceUri')[copyIndex('varWebhookReceivers')]))]\",\r\n \"identifierUri\": \"null()\",\r\n \"objectId\": \"null()\",\r\n \"serviceUri\": \"[[trim(parameters('ALZWebhookServiceUri')[copyIndex('varWebhookReceivers')])]\",\r\n \"useCommonAlertSchema\": true,\r\n \"tenantId\": \"null()\",\r\n \"useAadAuth\": \"false\"\r\n }\r\n },\r\n {\r\n \"name\": \"varAGIds\",\r\n \"count\": \"[[length(parameters('BYOActionGroup'))]\",\r\n \"mode\": \"serial\",\r\n \"input\": \"[[trim(parameters('BYOActionGroup')[copyIndex('varAGIds')])]\"\r\n }\r\n ]\r\n },\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Resources/resourceGroups\",\r\n \"apiVersion\": \"2021-04-01\",\r\n \"name\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"location\": \"[[parameters('ALZMonitorResourceGroupLocation')]\",\r\n \"tags\": \"[[parameters('ALZMonitorResourceGroupTags')]\"\r\n },\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"ActionGroupDeployment\",\r\n \"resourceGroup\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"dependsOn\": [\r\n \"[[concat('Microsoft.Resources/resourceGroups/', parameters('ALZMonitorResourceGroupName'))]\"\r\n ],\r\n \"properties\": {\r\n \"mode\": \"Incremental\",\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZMonitorActionGroupEmail\": {\r\n \"type\": \"Array\"\r\n },\r\n \"ALZLogicappResourceId\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZLogicappCallbackUrl\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZArmRoleId\": {\r\n \"type\": \"array\"\r\n },\r\n \"ALZEventHubResourceId\": {\r\n \"type\": \"array\"\r\n },\r\n \"ALZWebhookServiceUri\": {\r\n \"type\": \"Array\"\r\n },\r\n \"ALZFunctionResourceId\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZFunctionTriggerUrl\": {\r\n \"type\": \"string\"\r\n },\r\n \"BYOActionGroup\": {\r\n \"type\": \"array\"\r\n },\r\n \"BYOAlertProcessingRule\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"condition\": \"[[and(empty(parameters('BYOActionGroup')), empty(parameters('BYOAlertProcessingRule')))]\",\r\n \"type\": \"Microsoft.Insights/actionGroups\",\r\n \"apiVersion\": \"2023-01-01\",\r\n \"name\": \"[[concat('ag-AMBA-', subscription().displayName, '-001')]\",\r\n \"location\": \"Global\",\r\n \"tags\": {\r\n \"_deployed_by_amba\": true\r\n },\r\n \"properties\": {\r\n \"groupShortName\": \"ActGrp\",\r\n \"enabled\": true,\r\n \"emailReceivers\": \"[[if(empty(parameters('ALZMonitorActionGroupEmail')), null(), variables('varEmailReceivers'))]\",\r\n \"armRoleReceivers\": \"[[if(empty(parameters('ALZArmRoleId')), null(), variables('varArmRoleReceivers'))]\",\r\n \"logicAppReceivers\": \"[[if(empty(parameters('ALZLogicappResourceId')), null(), variables('varLogicAppReceivers'))]\",\r\n \"eventHubReceivers\": \"[[if(empty(parameters('ALZEventHubResourceId')), null(), variables('varEventHubReceivers'))]\",\r\n \"webhookReceivers\": \"[[if(empty(parameters('ALZWebhookServiceUri')), null(), variables('varWebhookReceivers'))]\",\r\n \"azureFunctionReceivers\": \"[[if(empty(parameters('ALZFunctionResourceId')), null(), variables('varAzureFunctionReceivers'))]\"\r\n }\r\n },\r\n {\r\n \"condition\": \"[[empty(parameters('BYOAlertProcessingRule'))]\",\r\n \"type\": \"Microsoft.AlertsManagement/actionRules\",\r\n \"apiVersion\": \"2021-08-08\",\r\n \"name\": \"[[concat('apr-AMBA-',subscription().displayName, '-001')]\",\r\n \"location\": \"Global\",\r\n \"dependsOn\": [\r\n \"[[concat('ag-AMBA-', subscription().displayName, '-001')]\"\r\n ],\r\n \"tags\": {\r\n \"_deployed_by_amba\": true\r\n },\r\n \"properties\": {\r\n \"scopes\": [\r\n \"[[subscription().Id]\"\r\n ],\r\n \"description\": \"AMBA Notification Assets - Alert Processing Rule for Subscription\",\r\n \"enabled\": true,\r\n \"actions\": [\r\n {\r\n \"actiongroupIds\": \"[[if(empty(parameters('BYOActionGroup')), array(concat(subscription().Id, '/resourceGroups/', parameters('ALZMonitorResourceGroupName'), '/providers/microsoft.insights/actionGroups/', 'ag-AMBA-', subscription().displayName, '-001')), variables('varAGIds'))]\",\r\n \"actionType\": \"AddActionGroups\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupName')]\"\r\n },\r\n \"ALZMonitorActionGroupEmail\": {\r\n \"value\": \"[[parameters('ALZMonitorActionGroupEmail')]\"\r\n },\r\n \"ALZLogicappResourceId\": {\r\n \"value\": \"[[parameters('ALZLogicappResourceId')]\"\r\n },\r\n \"ALZLogicappCallbackUrl\": {\r\n \"value\": \"[[parameters('ALZLogicappCallbackUrl')]\"\r\n },\r\n \"ALZArmRoleId\": {\r\n \"value\": \"[[parameters('ALZArmRoleId')]\"\r\n },\r\n \"ALZEventHubResourceId\": {\r\n \"value\": \"[[parameters('ALZEventHubResourceId')]\"\r\n },\r\n \"ALZWebhookServiceUri\": {\r\n \"value\": \"[[parameters('ALZWebhookServiceUri')]\"\r\n },\r\n \"ALZFunctionResourceId\": {\r\n \"value\": \"[[parameters('ALZFunctionResourceId')]\"\r\n },\r\n \"ALZFunctionTriggerUrl\": {\r\n \"value\": \"[[parameters('ALZFunctionTriggerUrl')]\"\r\n },\r\n \"BYOActionGroup\": {\r\n \"value\": \"[[parameters('BYOActionGroup')]\"\r\n },\r\n \"BYOAlertProcessingRule\": {\r\n \"value\": \"[[parameters('BYOAlertProcessingRule')]\"\r\n }\r\n }\r\n }\r\n }\r\n ]\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupName')]\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupTags')]\"\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupLocation')]\"\r\n },\r\n \"ALZMonitorActionGroupEmail\": {\r\n \"value\": \"[[parameters('ALZMonitorActionGroupEmail')]\"\r\n },\r\n \"ALZLogicappResourceId\": {\r\n \"value\": \"[[parameters('ALZLogicappResourceId')]\"\r\n },\r\n \"ALZLogicappCallbackUrl\": {\r\n \"value\": \"[[parameters('ALZLogicappCallbackUrl')]\"\r\n },\r\n \"ALZArmRoleId\": {\r\n \"value\": \"[[parameters('ALZArmRoleId')]\"\r\n },\r\n \"ALZEventHubResourceId\": {\r\n \"value\": \"[[parameters('ALZEventHubResourceId')]\"\r\n },\r\n \"ALZWebhookServiceUri\": {\r\n \"value\": \"[[parameters('ALZWebhookServiceUri')]\"\r\n },\r\n \"ALZFunctionResourceId\": {\r\n \"value\": \"[[parameters('ALZFunctionResourceId')]\"\r\n },\r\n \"ALZFunctionTriggerUrl\": {\r\n \"value\": \"[[parameters('ALZFunctionTriggerUrl')]\"\r\n },\r\n \"BYOActionGroup\": {\r\n \"value\": \"[[parameters('BYOActionGroup')]\"\r\n },\r\n \"BYOAlertProcessingRule\": {\r\n \"value\": \"[[parameters('BYOAlertProcessingRule')]\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n", - "$fxv#1": "{\r\n \"type\": \"Microsoft.Authorization/policyDefinitions\",\r\n \"apiVersion\": \"2021-06-01\",\r\n \"name\": \"Deploy_Suppression_AlertProcessing_Rule\",\r\n \"properties\": {\r\n \"policyType\": \"Custom\",\r\n \"mode\": \"All\",\r\n \"displayName\": \"Deploy AMBA Notification Suppression Asset\",\r\n \"description\": \"Policy to deploy empty and disabled suppression Alert Processing Rule for all AMBA alerts\",\r\n \"metadata\": {\r\n \"version\": \"1.1.0\",\r\n \"category\": \"Monitoring\",\r\n \"source\": \"https://github.com/Azure/azure-monitor-baseline-alerts/\",\r\n \"alzCloudEnvironments\": [\r\n \"AzureCloud\"\r\n ],\r\n \"_deployed_by_amba\": \"True\"\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Name\",\r\n \"description\": \"Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": \"rg-amba-monitoring-001\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"type\": \"Object\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Tags\",\r\n \"description\": \"Tags on the Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": {\r\n \"_deployed_by_amba\": true\r\n }\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Location\",\r\n \"description\": \"Location of the Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": \"centralus\"\r\n },\r\n \"MonitorDisableTagName\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"ALZ Monitoring disabled tag name\",\r\n \"description\": \"Tag name used to disable monitoring at the resource level. Set to true if monitoring should be disabled.\"\r\n },\r\n \"defaultValue\": \"MonitorDisable\"\r\n },\r\n \"MonitorDisableTagValues\": {\r\n \"type\": \"Array\",\r\n \"metadata\": {\r\n \"displayName\": \"ALZ Monitoring disabled tag values(s)\",\r\n \"description\": \"Tag value(s) used to disable monitoring at the resource level. Set to true if monitoring should be disabled.\"\r\n },\r\n \"defaultValue\": [\r\n \"true\",\r\n \"Test\",\r\n \"Dev\",\r\n \"Sandbox\"\r\n ]\r\n }\r\n },\r\n \"policyRule\": {\r\n \"if\": {\r\n \"allOf\": [\r\n {\r\n \"field\": \"type\",\r\n \"equals\": \"Microsoft.Resources/subscriptions\"\r\n },\r\n {\r\n \"field\": \"[[concat('tags[', parameters('MonitorDisableTagName'), ']')]\",\r\n \"notIn\": \"[[parameters('MonitorDisableTagValues')]\"\r\n }\r\n ]\r\n },\r\n \"then\": {\r\n \"effect\": \"deployIfNotExists\",\r\n \"details\": {\r\n \"roleDefinitionIds\": [\r\n \"/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c\"\r\n ],\r\n \"type\": \"Microsoft.AlertsManagement/actionRules\",\r\n \"existenceScope\": \"resourceGroup\",\r\n \"resourceGroupName\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"deploymentScope\": \"subscription\",\r\n \"existenceCondition\": {\r\n \"allOf\": [\r\n {\r\n \"field\": \"Microsoft.AlertsManagement/actionRules/description\",\r\n \"equals\": \"AMBA Notification Assets - Suppression Alert Processing Rule for maintenance period for Subscription\"\r\n }\r\n ]\r\n },\r\n \"deployment\": {\r\n \"location\": \"northeurope\",\r\n \"properties\": {\r\n \"mode\": \"incremental\",\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"type\": \"object\"\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Resources/resourceGroups\",\r\n \"apiVersion\": \"2021-04-01\",\r\n \"name\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"location\": \"[[parameters('ALZMonitorResourceGroupLocation')]\",\r\n \"tags\": \"[[parameters('ALZMonitorResourceGroupTags')]\"\r\n },\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"SuppressionRuleDeployment\",\r\n \"resourceGroup\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"dependsOn\": [\r\n \"[[concat('Microsoft.Resources/resourceGroups/', parameters('ALZMonitorResourceGroupName'))]\"\r\n ],\r\n \"properties\": {\r\n \"mode\": \"Incremental\",\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.AlertsManagement/actionRules\",\r\n \"apiVersion\": \"2021-08-08\",\r\n \"name\": \"[[concat('apr-AMBA-',subscription().displayName, '-002')]\",\r\n \"location\": \"Global\",\r\n \"dependsOn\": [],\r\n \"tags\": {\r\n \"_deployed_by_amba\": true\r\n },\r\n \"properties\": {\r\n \"scopes\": [\r\n \"[[subscription().Id]\"\r\n ],\r\n \"description\": \"AMBA Notification Assets - Suppression Alert Processing Rule for maintenance period for Subscription\",\r\n \"enabled\": false,\r\n \"actions\": [\r\n {\r\n \"actionType\": \"RemoveAllActionGroups\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupName')]\"\r\n }\r\n }\r\n }\r\n }\r\n ]\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupName')]\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupTags')]\"\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupLocation')]\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n", + "$fxv#0": "{\r\n \"type\": \"Microsoft.Authorization/policyDefinitions\",\r\n \"apiVersion\": \"2021-06-01\",\r\n \"name\": \"Deploy_AlertProcessing_Rule\",\r\n \"properties\": {\r\n \"policyType\": \"Custom\",\r\n \"mode\": \"All\",\r\n \"displayName\": \"Deploy AMBA Notification Assets\",\r\n \"description\": \"Policy to deploy Action Group and Alert Processing Rule for all AMBA alerts\",\r\n \"metadata\": {\r\n \"version\": \"1.5.0\",\r\n \"category\": \"Monitoring\",\r\n \"source\": \"https://github.com/Azure/azure-monitor-baseline-alerts/\",\r\n \"alzCloudEnvironments\": [\r\n \"AzureCloud\"\r\n ],\r\n \"_deployed_by_amba\": \"True\"\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Name\",\r\n \"description\": \"Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": \"rg-amba-monitoring-001\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"type\": \"Object\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Tags\",\r\n \"description\": \"Tags on the Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": {\r\n \"_deployed_by_amba\": true\r\n }\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Location\",\r\n \"description\": \"Location of the Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": \"centralus\"\r\n },\r\n \"ALZMonitorActionGroupEmail\": {\r\n \"type\": \"Array\",\r\n \"metadata\": {\r\n \"displayName\": \"Action Group Email Addresses\",\r\n \"description\": \"Email addresses to send alerts to\"\r\n },\r\n \"defaultValue\": []\r\n },\r\n \"ALZLogicappResourceId\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Logic App Resource Id\",\r\n \"description\": \"Logic App Resource Id for Action Group to send alerts to\"\r\n },\r\n \"defaultValue\": \"\"\r\n },\r\n \"ALZLogicappCallbackUrl\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Logic App Callback URL\",\r\n \"description\": \"Callback URL that triggers the Logic App\"\r\n },\r\n \"defaultValue\": \"\"\r\n },\r\n \"ALZArmRoleId\": {\r\n \"type\": \"array\",\r\n \"metadata\": {\r\n \"displayName\": \"Arm Role Ids\",\r\n \"description\": \"Arm Built-in Role Ids for action group to send alerts to\"\r\n },\r\n \"defaultValue\": []\r\n },\r\n \"ALZEventHubResourceId\": {\r\n \"type\": \"array\",\r\n \"metadata\": {\r\n \"displayName\": \"Event Hub resource Ids\",\r\n \"description\": \"Event Hub resource Ids for action group to send alerts to\"\r\n },\r\n \"defaultValue\": []\r\n },\r\n \"ALZWebhookServiceUri\": {\r\n \"type\": \"Array\",\r\n \"metadata\": {\r\n \"displayName\": \"Webhook Service Uri(s)\",\r\n \"description\": \"Indicates the service uri(s) of the webhook to send alerts to\"\r\n },\r\n \"defaultValue\": []\r\n },\r\n \"ALZFunctionResourceId\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Function Resource Id\",\r\n \"description\": \"Function Resource Id for Action Group to send alerts to\"\r\n },\r\n \"defaultValue\": \"\"\r\n },\r\n \"ALZFunctionTriggerUrl\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Function Trigger URL\",\r\n \"description\": \"URL that triggers the Function\"\r\n },\r\n \"defaultValue\": \"\"\r\n },\r\n \"ALZNotificationAssetSuffix\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Notification Asset Name Suffix\",\r\n \"description\": \"Suffix for Alert Processing Rule and Action Group names\"\r\n },\r\n \"defaultValue\": \"-001\"\r\n },\r\n \"ALZAlertSeverity\": {\r\n \"type\": \"Array\",\r\n \"metadata\": {\r\n \"displayName\": \"Alert Severities for Alert Processing Rule\",\r\n \"description\": \"Severity of the alerts to apply action groups. Will apply to all severities if not specified.\"\r\n },\r\n \"defaultValue\": [\r\n \"Sev0\",\r\n \"Sev1\",\r\n \"Sev2\",\r\n \"Sev3\",\r\n \"Sev4\"\r\n ]\r\n },\r\n \"BYOActionGroup\": {\r\n \"type\": \"array\",\r\n \"metadata\": {\r\n \"displayName\": \"Customer defined Action Group Resource IDs\",\r\n \"description\": \"The Resource IDs of existing Action Groups currently deployed in the environment.\"\r\n },\r\n \"defaultValue\": []\r\n },\r\n \"BYOAlertProcessingRule\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Customer defined Alert Processing Rule Resource ID\",\r\n \"description\": \"The Resource ID of an existing Alert Processing Rule already deployed by the customer in his environment\"\r\n },\r\n \"defaultValue\": \"\"\r\n },\r\n \"MonitorDisableTagName\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"ALZ Monitoring disabled tag name\",\r\n \"description\": \"Tag name to disable monitoring. Set to true if monitoring should be disabled\"\r\n },\r\n \"defaultValue\": \"MonitorDisable\"\r\n },\r\n \"MonitorDisableTagValues\": {\r\n \"type\": \"Array\",\r\n \"metadata\": {\r\n \"displayName\": \"ALZ Monitoring disabled tag values(s)\",\r\n \"description\": \"Tag value(s) used to disable monitoring at the resource level. Set to true if monitoring should be disabled.\"\r\n },\r\n \"defaultValue\": [\r\n \"true\",\r\n \"Test\",\r\n \"Dev\",\r\n \"Sandbox\"\r\n ]\r\n }\r\n },\r\n \"policyRule\": {\r\n \"if\": {\r\n \"allOf\": [\r\n {\r\n \"field\": \"type\",\r\n \"equals\": \"Microsoft.Resources/subscriptions\"\r\n },\r\n {\r\n \"field\": \"[[concat('tags[', parameters('MonitorDisableTagName'), ']')]\",\r\n \"notIn\": \"[[parameters('MonitorDisableTagValues')]\"\r\n },\r\n {\r\n \"value\": \"[[empty(parameters('BYOAlertProcessingRule'))]\",\r\n \"equals\": \"true\"\r\n }\r\n ]\r\n },\r\n \"then\": {\r\n \"effect\": \"deployIfNotExists\",\r\n \"details\": {\r\n \"roleDefinitionIds\": [\r\n \"/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c\"\r\n ],\r\n \"type\": \"Microsoft.AlertsManagement/actionRules\",\r\n \"existenceScope\": \"resourceGroup\",\r\n \"resourceGroupName\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"deploymentScope\": \"subscription\",\r\n \"existenceCondition\": {\r\n \"allOf\": [\r\n {\r\n \"field\": \"Microsoft.AlertsManagement/actionRules/description\",\r\n \"equals\": \"[[concat('AMBA Notification Assets - Alert Processing Rule for Subscription', parameters('ALZNotificationAssetSuffix'))]\"\r\n }\r\n ]\r\n },\r\n \"deployment\": {\r\n \"location\": \"northeurope\",\r\n \"properties\": {\r\n \"mode\": \"incremental\",\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"type\": \"object\"\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZMonitorActionGroupEmail\": {\r\n \"type\": \"Array\"\r\n },\r\n \"ALZLogicappResourceId\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZLogicappCallbackUrl\": {\r\n \"type\": \"String\"\r\n },\r\n \"ALZArmRoleId\": {\r\n \"type\": \"array\"\r\n },\r\n \"ALZEventHubResourceId\": {\r\n \"type\": \"array\"\r\n },\r\n \"ALZWebhookServiceUri\": {\r\n \"type\": \"Array\"\r\n },\r\n \"ALZFunctionResourceId\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZFunctionTriggerUrl\": {\r\n \"type\": \"String\"\r\n },\r\n \"ALZNotificationAssetSuffix\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZAlertSeverity\": {\r\n \"type\": \"Array\"\r\n },\r\n \"BYOActionGroup\": {\r\n \"type\": \"array\"\r\n },\r\n \"BYOAlertProcessingRule\": {\r\n \"type\": \"String\"\r\n }\r\n },\r\n \"variables\": {\r\n \"varBYOAlertProcessingRule\": \"[[if(empty(parameters('BYOAlertProcessingRule')), null(), trim(parameters('BYOAlertProcessingRule')))]\",\r\n \"varLogicAppReceivers\": [\r\n {\r\n \"name\": \"AlzLA-0\",\r\n \"resourceId\": \"[[if(empty(parameters('ALZLogicappResourceId')), null(), trim(parameters('ALZLogicappResourceId')))]\",\r\n \"callbackUrl\": \"[[if(empty(parameters('ALZLogicappCallbackUrl')), null(), trim(parameters('ALZLogicappCallbackUrl')))]\",\r\n \"useCommonAlertSchema\": true\r\n }\r\n ],\r\n \"varAzureFunctionReceivers\": [\r\n {\r\n \"name\": \"AlzFa-0\",\r\n \"functionAppResourceId\": \"[[if(empty(parameters('ALZFunctionResourceId')), null(), split(trim(parameters('ALZFunctionResourceId')),'/functions/')[0])]\",\r\n \"functionName\": \"[[if(empty(parameters('ALZFunctionResourceId')), null(), split(trim(parameters('ALZFunctionResourceId')),'/')[10])]\",\r\n \"httpTriggerUrl\": \"[[if(empty(parameters('ALZFunctionTriggerUrl')), null(), trim(parameters('ALZFunctionTriggerUrl')))]\",\r\n \"useCommonAlertSchema\": true\r\n }\r\n ],\r\n \"copy\": [\r\n {\r\n \"name\": \"varEmailReceivers\",\r\n \"count\": \"[[length(parameters('ALZMonitorActionGroupEmail'))]\",\r\n \"mode\": \"serial\",\r\n \"input\": {\r\n \"name\": \"[[concat('AlzMail-', indexOf(parameters('ALZMonitorActionGroupEmail'), parameters('ALZMonitorActionGroupEmail')[copyIndex('varEmailReceivers')]))]\",\r\n \"emailAddress\": \"[[trim(parameters('ALZMonitorActionGroupEmail')[copyIndex('varEmailReceivers')])]\",\r\n \"useCommonAlertSchema\": false\r\n }\r\n },\r\n {\r\n \"name\": \"varArmRoleReceivers\",\r\n \"count\": \"[[length(parameters('ALZArmRoleId'))]\",\r\n \"mode\": \"serial\",\r\n \"input\": {\r\n \"name\": \"[[concat('AlzARM-', indexOf(parameters('ALZArmRoleId'), parameters('ALZArmRoleId')[copyIndex('varArmRoleReceivers')]))]\",\r\n \"roleId\": \"[[trim(parameters('ALZArmRoleId')[copyIndex('varArmRoleReceivers')])]\",\r\n \"useCommonAlertSchema\": true\r\n }\r\n },\r\n {\r\n \"name\": \"varEventHubReceivers\",\r\n \"count\": \"[[length(parameters('ALZEventHubResourceId'))]\",\r\n \"mode\": \"serial\",\r\n \"input\": {\r\n \"name\": \"[[concat('AlzEH-', indexOf(parameters('ALZEventHubResourceId'), parameters('ALZEventHubResourceId')[copyIndex('varEventHubReceivers')]))]\",\r\n \"subscriptionId\": \"[[if(empty(parameters('ALZEventHubResourceId')), null(), split(trim(parameters('ALZEventHubResourceId')[copyIndex('varEventHubReceivers')]),'/')[2])]\",\r\n \"eventHubNameSpace\": \"[[if(empty(parameters('ALZEventHubResourceId')), null(), split(trim(parameters('ALZEventHubResourceId')[copyIndex('varEventHubReceivers')]),'/')[8])]\",\r\n \"eventHubName\": \"[[if(empty(parameters('ALZEventHubResourceId')), null(), split(trim(parameters('ALZEventHubResourceId')[copyIndex('varEventHubReceivers')]),'/')[10])]\",\r\n \"useCommonAlertSchema\": true,\r\n \"tenantId\": \"[[subscription().tenantId]\"\r\n }\r\n },\r\n {\r\n \"name\": \"varWebhookReceivers\",\r\n \"count\": \"[[length(parameters('ALZWebhookServiceUri'))]\",\r\n \"mode\": \"serial\",\r\n \"input\": {\r\n \"name\": \"[[concat('AlzWh-', indexOf(parameters('ALZWebhookServiceUri'), parameters('ALZWebhookServiceUri')[copyIndex('varWebhookReceivers')]))]\",\r\n \"identifierUri\": \"null()\",\r\n \"objectId\": \"null()\",\r\n \"serviceUri\": \"[[trim(parameters('ALZWebhookServiceUri')[copyIndex('varWebhookReceivers')])]\",\r\n \"useCommonAlertSchema\": true,\r\n \"tenantId\": \"null()\",\r\n \"useAadAuth\": \"false\"\r\n }\r\n },\r\n {\r\n \"name\": \"varAGIds\",\r\n \"count\": \"[[length(parameters('BYOActionGroup'))]\",\r\n \"mode\": \"serial\",\r\n \"input\": \"[[trim(parameters('BYOActionGroup')[copyIndex('varAGIds')])]\"\r\n }\r\n ]\r\n },\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Resources/resourceGroups\",\r\n \"apiVersion\": \"2021-04-01\",\r\n \"name\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"location\": \"[[parameters('ALZMonitorResourceGroupLocation')]\",\r\n \"tags\": \"[[parameters('ALZMonitorResourceGroupTags')]\"\r\n },\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"ActionGroupDeployment\",\r\n \"resourceGroup\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"dependsOn\": [\r\n \"[[concat('Microsoft.Resources/resourceGroups/', parameters('ALZMonitorResourceGroupName'))]\"\r\n ],\r\n \"properties\": {\r\n \"mode\": \"Incremental\",\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZMonitorActionGroupEmail\": {\r\n \"type\": \"Array\"\r\n },\r\n \"ALZLogicappResourceId\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZLogicappCallbackUrl\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZArmRoleId\": {\r\n \"type\": \"array\"\r\n },\r\n \"ALZEventHubResourceId\": {\r\n \"type\": \"array\"\r\n },\r\n \"ALZWebhookServiceUri\": {\r\n \"type\": \"Array\"\r\n },\r\n \"ALZFunctionResourceId\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZFunctionTriggerUrl\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZNotificationAssetSuffix\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZAlertSeverity\": {\r\n \"type\": \"Array\"\r\n },\r\n \"BYOActionGroup\": {\r\n \"type\": \"array\"\r\n },\r\n \"BYOAlertProcessingRule\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"condition\": \"[[and(empty(parameters('BYOActionGroup')), empty(parameters('BYOAlertProcessingRule')))]\",\r\n \"type\": \"Microsoft.Insights/actionGroups\",\r\n \"apiVersion\": \"2023-01-01\",\r\n \"name\": \"[[concat('ag-AMBA-', subscription().displayName, parameters('ALZNotificationAssetSuffix'))]\",\r\n \"location\": \"Global\",\r\n \"tags\": {\r\n \"_deployed_by_amba\": true\r\n },\r\n \"properties\": {\r\n \"groupShortName\": \"ActGrp\",\r\n \"enabled\": true,\r\n \"emailReceivers\": \"[[if(empty(parameters('ALZMonitorActionGroupEmail')), null(), variables('varEmailReceivers'))]\",\r\n \"armRoleReceivers\": \"[[if(empty(parameters('ALZArmRoleId')), null(), variables('varArmRoleReceivers'))]\",\r\n \"logicAppReceivers\": \"[[if(empty(parameters('ALZLogicappResourceId')), null(), variables('varLogicAppReceivers'))]\",\r\n \"eventHubReceivers\": \"[[if(empty(parameters('ALZEventHubResourceId')), null(), variables('varEventHubReceivers'))]\",\r\n \"webhookReceivers\": \"[[if(empty(parameters('ALZWebhookServiceUri')), null(), variables('varWebhookReceivers'))]\",\r\n \"azureFunctionReceivers\": \"[[if(empty(parameters('ALZFunctionResourceId')), null(), variables('varAzureFunctionReceivers'))]\"\r\n }\r\n },\r\n {\r\n \"condition\": \"[[empty(parameters('BYOAlertProcessingRule'))]\",\r\n \"type\": \"Microsoft.AlertsManagement/actionRules\",\r\n \"apiVersion\": \"2021-08-08\",\r\n \"name\": \"[[concat('apr-AMBA-',subscription().displayName, parameters('ALZNotificationAssetSuffix'))]\",\r\n \"location\": \"Global\",\r\n \"dependsOn\": [\r\n \"[[concat('ag-AMBA-', subscription().displayName, parameters('ALZNotificationAssetSuffix'))]\"\r\n ],\r\n \"tags\": {\r\n \"_deployed_by_amba\": true\r\n },\r\n \"properties\": {\r\n \"scopes\": [\r\n \"[[subscription().Id]\"\r\n ],\r\n \"description\": \"[[concat('AMBA Notification Assets - Alert Processing Rule for Subscription', parameters('ALZNotificationAssetSuffix'))]\",\r\n \"conditions\": [\r\n {\r\n \"field\": \"severity\",\r\n \"operator\": \"Equals\",\r\n \"values\": \"[[parameters('ALZAlertSeverity')]\"\r\n }\r\n ],\r\n \"enabled\": true,\r\n \"actions\": [\r\n {\r\n \"actiongroupIds\": \"[[if(empty(parameters('BYOActionGroup')), array(concat(subscription().Id, '/resourceGroups/', parameters('ALZMonitorResourceGroupName'), '/providers/microsoft.insights/actionGroups/', 'ag-AMBA-', subscription().displayName, parameters('ALZNotificationAssetSuffix'))), variables('varAGIds'))]\",\r\n \"actionType\": \"AddActionGroups\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupName')]\"\r\n },\r\n \"ALZMonitorActionGroupEmail\": {\r\n \"value\": \"[[parameters('ALZMonitorActionGroupEmail')]\"\r\n },\r\n \"ALZLogicappResourceId\": {\r\n \"value\": \"[[parameters('ALZLogicappResourceId')]\"\r\n },\r\n \"ALZLogicappCallbackUrl\": {\r\n \"value\": \"[[parameters('ALZLogicappCallbackUrl')]\"\r\n },\r\n \"ALZArmRoleId\": {\r\n \"value\": \"[[parameters('ALZArmRoleId')]\"\r\n },\r\n \"ALZEventHubResourceId\": {\r\n \"value\": \"[[parameters('ALZEventHubResourceId')]\"\r\n },\r\n \"ALZWebhookServiceUri\": {\r\n \"value\": \"[[parameters('ALZWebhookServiceUri')]\"\r\n },\r\n \"ALZFunctionResourceId\": {\r\n \"value\": \"[[parameters('ALZFunctionResourceId')]\"\r\n },\r\n \"ALZFunctionTriggerUrl\": {\r\n \"value\": \"[[parameters('ALZFunctionTriggerUrl')]\"\r\n },\r\n \"ALZNotificationAssetSuffix\":{\r\n \"value\": \"[[parameters('ALZNotificationAssetSuffix')]\"\r\n },\r\n \"ALZAlertSeverity\": {\r\n \"value\": \"[[parameters('ALZAlertSeverity')]\"\r\n },\r\n \"BYOActionGroup\": {\r\n \"value\": \"[[parameters('BYOActionGroup')]\"\r\n },\r\n \"BYOAlertProcessingRule\": {\r\n \"value\": \"[[parameters('BYOAlertProcessingRule')]\"\r\n }\r\n }\r\n }\r\n }\r\n ]\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupName')]\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupTags')]\"\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupLocation')]\"\r\n },\r\n \"ALZMonitorActionGroupEmail\": {\r\n \"value\": \"[[parameters('ALZMonitorActionGroupEmail')]\"\r\n },\r\n \"ALZLogicappResourceId\": {\r\n \"value\": \"[[parameters('ALZLogicappResourceId')]\"\r\n },\r\n \"ALZLogicappCallbackUrl\": {\r\n \"value\": \"[[parameters('ALZLogicappCallbackUrl')]\"\r\n },\r\n \"ALZArmRoleId\": {\r\n \"value\": \"[[parameters('ALZArmRoleId')]\"\r\n },\r\n \"ALZEventHubResourceId\": {\r\n \"value\": \"[[parameters('ALZEventHubResourceId')]\"\r\n },\r\n \"ALZWebhookServiceUri\": {\r\n \"value\": \"[[parameters('ALZWebhookServiceUri')]\"\r\n },\r\n \"ALZFunctionResourceId\": {\r\n \"value\": \"[[parameters('ALZFunctionResourceId')]\"\r\n },\r\n \"ALZFunctionTriggerUrl\": {\r\n \"value\": \"[[parameters('ALZFunctionTriggerUrl')]\"\r\n },\r\n \"ALZNotificationAssetSuffix\":{\r\n \"value\": \"[[parameters('ALZNotificationAssetSuffix')]\"\r\n },\r\n \"ALZAlertSeverity\": {\r\n \"value\": \"[[parameters('ALZAlertSeverity')]\"\r\n },\r\n \"BYOActionGroup\": {\r\n \"value\": \"[[parameters('BYOActionGroup')]\"\r\n },\r\n \"BYOAlertProcessingRule\": {\r\n \"value\": \"[[parameters('BYOAlertProcessingRule')]\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n", + "$fxv#1": "{\r\n \"type\": \"Microsoft.Authorization/policyDefinitions\",\r\n \"apiVersion\": \"2021-06-01\",\r\n \"name\": \"Deploy_Suppression_AlertProcessing_Rule\",\r\n \"properties\": {\r\n \"policyType\": \"Custom\",\r\n \"mode\": \"All\",\r\n \"displayName\": \"Deploy AMBA Notification Suppression Asset\",\r\n \"description\": \"Policy to deploy empty and disabled suppression Alert Processing Rule for all AMBA alerts\",\r\n \"metadata\": {\r\n \"version\": \"1.1.0\",\r\n \"category\": \"Monitoring\",\r\n \"source\": \"https://github.com/Azure/azure-monitor-baseline-alerts/\",\r\n \"alzCloudEnvironments\": [\r\n \"AzureCloud\"\r\n ],\r\n \"_deployed_by_amba\": \"True\"\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Name\",\r\n \"description\": \"Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": \"rg-amba-monitoring-001\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"type\": \"Object\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Tags\",\r\n \"description\": \"Tags on the Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": {\r\n \"_deployed_by_amba\": true\r\n }\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"Resource Group Location\",\r\n \"description\": \"Location of the Resource group the alert is placed in\"\r\n },\r\n \"defaultValue\": \"centralus\"\r\n },\r\n \"MonitorDisableTagName\": {\r\n \"type\": \"String\",\r\n \"metadata\": {\r\n \"displayName\": \"ALZ Monitoring disabled tag name\",\r\n \"description\": \"Tag name used to disable monitoring at the resource level. Set to true if monitoring should be disabled.\"\r\n },\r\n \"defaultValue\": \"MonitorDisable\"\r\n },\r\n \"MonitorDisableTagValues\": {\r\n \"type\": \"Array\",\r\n \"metadata\": {\r\n \"displayName\": \"ALZ Monitoring disabled tag values(s)\",\r\n \"description\": \"Tag value(s) used to disable monitoring at the resource level. Set to true if monitoring should be disabled.\"\r\n },\r\n \"defaultValue\": [\r\n \"true\",\r\n \"Test\",\r\n \"Dev\",\r\n \"Sandbox\"\r\n ]\r\n }\r\n },\r\n \"policyRule\": {\r\n \"if\": {\r\n \"allOf\": [\r\n {\r\n \"field\": \"type\",\r\n \"equals\": \"Microsoft.Resources/subscriptions\"\r\n },\r\n {\r\n \"field\": \"[[concat('tags[', parameters('MonitorDisableTagName'), ']')]\",\r\n \"notIn\": \"[[parameters('MonitorDisableTagValues')]\"\r\n }\r\n ]\r\n },\r\n \"then\": {\r\n \"effect\": \"deployIfNotExists\",\r\n \"details\": {\r\n \"roleDefinitionIds\": [\r\n \"/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c\"\r\n ],\r\n \"type\": \"Microsoft.AlertsManagement/actionRules\",\r\n \"existenceScope\": \"resourceGroup\",\r\n \"resourceGroupName\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"deploymentScope\": \"subscription\",\r\n \"existenceCondition\": {\r\n \"allOf\": [\r\n {\r\n \"field\": \"Microsoft.AlertsManagement/actionRules/description\",\r\n \"equals\": \"AMBA Notification Assets - Suppression Alert Processing Rule for maintenance period for Subscription\"\r\n }\r\n ]\r\n },\r\n \"deployment\": {\r\n \"location\": \"northeurope\",\r\n \"properties\": {\r\n \"mode\": \"incremental\",\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"string\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"type\": \"object\"\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.Resources/resourceGroups\",\r\n \"apiVersion\": \"2021-04-01\",\r\n \"name\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"location\": \"[[parameters('ALZMonitorResourceGroupLocation')]\",\r\n \"tags\": \"[[parameters('ALZMonitorResourceGroupTags')]\"\r\n },\r\n {\r\n \"type\": \"Microsoft.Resources/deployments\",\r\n \"apiVersion\": \"2019-10-01\",\r\n \"name\": \"SuppressionRuleDeployment\",\r\n \"resourceGroup\": \"[[parameters('ALZMonitorResourceGroupName')]\",\r\n \"dependsOn\": [\r\n \"[[concat('Microsoft.Resources/resourceGroups/', parameters('ALZMonitorResourceGroupName'))]\"\r\n ],\r\n \"properties\": {\r\n \"mode\": \"Incremental\",\r\n \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"variables\": {},\r\n \"resources\": [\r\n {\r\n \"type\": \"Microsoft.AlertsManagement/actionRules\",\r\n \"apiVersion\": \"2021-08-08\",\r\n \"name\": \"[[concat('apr-AMBA-',subscription().displayName, '-S001')]\",\r\n \"location\": \"Global\",\r\n \"dependsOn\": [],\r\n \"tags\": {\r\n \"_deployed_by_amba\": true\r\n },\r\n \"properties\": {\r\n \"scopes\": [\r\n \"[[subscription().Id]\"\r\n ],\r\n \"description\": \"AMBA Notification Assets - Suppression Alert Processing Rule for maintenance period for Subscription\",\r\n \"enabled\": false,\r\n \"actions\": [\r\n {\r\n \"actionType\": \"RemoveAllActionGroups\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupName')]\"\r\n }\r\n }\r\n }\r\n }\r\n ]\r\n },\r\n \"parameters\": {\r\n \"ALZMonitorResourceGroupName\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupName')]\"\r\n },\r\n \"ALZMonitorResourceGroupTags\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupTags')]\"\r\n },\r\n \"ALZMonitorResourceGroupLocation\": {\r\n \"value\": \"[[parameters('ALZMonitorResourceGroupLocation')]\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n", "$fxv#2": { "type": "Microsoft.Authorization/policySetDefinitions", "apiVersion": "2021-06-01", @@ -125,7 +125,7 @@ "displayName": "Deploy Azure Monitor Baseline Alerts - Notification Assets", "description": "This initiative deploys Notification Assets for Azure Monitor Baseline Alerts. This includes the setup of an Alert Processing Rule and an Action Group to manage notifications and actions, along with a Notification Suppression Rule to manage alert notifications, as well as a Notification Suppression Rule to control alert notifications.", "metadata": { - "version": "1.3.1", + "version": "1.4.1", "category": "Monitoring", "source": "https://github.com/Azure/azure-monitor-baseline-alerts/", "alzCloudEnvironments": [ @@ -245,6 +245,28 @@ }, "defaultValue": "" }, + "ALZNotificationAssetSuffix": { + "type": "String", + "metadata": { + "displayName": "Notification Asset Name Suffix", + "description": "Suffix for Alert Processing Rule and Action Group names" + }, + "defaultValue": "-001" + }, + "ALZAlertSeverity": { + "type": "Array", + "metadata": { + "displayName": "Alert Severities for Alert Processing Rule", + "description": "Severity of the alerts to apply action groups. Will apply to all severities if not specified." + }, + "defaultValue": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ] + }, "BYOActionGroup": { "type": "array", "metadata": { @@ -300,6 +322,12 @@ "ALZFunctionTriggerUrl": { "value": "[[[parameters('ALZFunctionTriggerUrl')]" }, + "ALZNotificationAssetSuffix": { + "value": "[[[parameters('ALZNotificationAssetSuffix')]" + }, + "ALZAlertSeverity": { + "value": "[[[parameters('ALZAlertSeverity')]" + }, "BYOActionGroup": { "value": "[[[parameters('BYOActionGroup')]" }, diff --git a/patterns/alz/policyDefinitions/policies-Web.json b/patterns/alz/policyDefinitions/policies-Web.json index cd38b5cbc..214850205 100644 --- a/patterns/alz/policyDefinitions/policies-Web.json +++ b/patterns/alz/policyDefinitions/policies-Web.json @@ -1003,4 +1003,4 @@ } } } -} \ No newline at end of file +} diff --git a/patterns/alz/policySetDefinitions/Deploy-Notification-Assets.json b/patterns/alz/policySetDefinitions/Deploy-Notification-Assets.json index 191f2605b..33761e615 100644 --- a/patterns/alz/policySetDefinitions/Deploy-Notification-Assets.json +++ b/patterns/alz/policySetDefinitions/Deploy-Notification-Assets.json @@ -6,7 +6,7 @@ "displayName": "Deploy Azure Monitor Baseline Alerts - Notification Assets", "description": "This initiative deploys Notification Assets for Azure Monitor Baseline Alerts. This includes the setup of an Alert Processing Rule and an Action Group to manage notifications and actions, along with a Notification Suppression Rule to manage alert notifications, as well as a Notification Suppression Rule to control alert notifications.", "metadata": { - "version": "1.3.1", + "version": "1.4.1", "category": "Monitoring", "source": "https://github.com/Azure/azure-monitor-baseline-alerts/", "alzCloudEnvironments": [ @@ -126,6 +126,28 @@ }, "defaultValue": "" }, + "ALZNotificationAssetSuffix": { + "type": "String", + "metadata": { + "displayName": "Notification Asset Name Suffix", + "description": "Suffix for Alert Processing Rule and Action Group names" + }, + "defaultValue": "-001" + }, + "ALZAlertSeverity": { + "type": "Array", + "metadata": { + "displayName": "Alert Severities for Alert Processing Rule", + "description": "Severity of the alerts to apply action groups. Will apply to all severities if not specified." + }, + "defaultValue": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ] + }, "BYOActionGroup": { "type": "array", "metadata": { @@ -181,6 +203,12 @@ "ALZFunctionTriggerUrl": { "value": "[[parameters('ALZFunctionTriggerUrl')]" }, + "ALZNotificationAssetSuffix": { + "value": "[[parameters('ALZNotificationAssetSuffix')]" + }, + "ALZAlertSeverity": { + "value": "[[parameters('ALZAlertSeverity')]" + }, "BYOActionGroup": { "value": "[[parameters('BYOActionGroup')]" }, diff --git a/services/AlertsManagement/actionRules/Deploy-AlertProcessingRule-Deploy.json b/services/AlertsManagement/actionRules/Deploy-AlertProcessingRule-Deploy.json index 4b1c6132c..f48370bab 100644 --- a/services/AlertsManagement/actionRules/Deploy-AlertProcessingRule-Deploy.json +++ b/services/AlertsManagement/actionRules/Deploy-AlertProcessingRule-Deploy.json @@ -8,7 +8,7 @@ "displayName": "Deploy AMBA Notification Assets", "description": "Policy to deploy Action Group and Alert Processing Rule for all AMBA alerts", "metadata": { - "version": "1.4.0", + "version": "1.5.0", "category": "Monitoring", "source": "https://github.com/Azure/azure-monitor-baseline-alerts/", "alzCloudEnvironments": [ @@ -107,6 +107,28 @@ }, "defaultValue": "" }, + "ALZNotificationAssetSuffix": { + "type": "String", + "metadata": { + "displayName": "Notification Asset Name Suffix", + "description": "Suffix for Alert Processing Rule and Action Group names" + }, + "defaultValue": "-001" + }, + "ALZAlertSeverity": { + "type": "Array", + "metadata": { + "displayName": "Alert Severities for Alert Processing Rule", + "description": "Severity of the alerts to apply action groups. Will apply to all severities if not specified." + }, + "defaultValue": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ] + }, "BYOActionGroup": { "type": "array", "metadata": { @@ -176,7 +198,7 @@ "allOf": [ { "field": "Microsoft.AlertsManagement/actionRules/description", - "equals": "AMBA Notification Assets - Alert Processing Rule for Subscription" + "equals": "[[concat('AMBA Notification Assets - Alert Processing Rule for Subscription', parameters('ALZNotificationAssetSuffix'))]" } ] }, @@ -221,6 +243,12 @@ "ALZFunctionTriggerUrl": { "type": "String" }, + "ALZNotificationAssetSuffix": { + "type": "string" + }, + "ALZAlertSeverity": { + "type": "Array" + }, "BYOActionGroup": { "type": "array" }, @@ -255,7 +283,7 @@ "input": { "name": "[[concat('AlzMail-', indexOf(parameters('ALZMonitorActionGroupEmail'), parameters('ALZMonitorActionGroupEmail')[copyIndex('varEmailReceivers')]))]", "emailAddress": "[[trim(parameters('ALZMonitorActionGroupEmail')[copyIndex('varEmailReceivers')])]", - "useCommonAlertSchema": true + "useCommonAlertSchema": false } }, { @@ -352,6 +380,12 @@ "ALZFunctionTriggerUrl": { "type": "string" }, + "ALZNotificationAssetSuffix": { + "type": "string" + }, + "ALZAlertSeverity": { + "type": "Array" + }, "BYOActionGroup": { "type": "array" }, @@ -365,7 +399,7 @@ "condition": "[[and(empty(parameters('BYOActionGroup')), empty(parameters('BYOAlertProcessingRule')))]", "type": "Microsoft.Insights/actionGroups", "apiVersion": "2023-01-01", - "name": "[[concat('ag-AMBA-', subscription().displayName, '-001')]", + "name": "[[concat('ag-AMBA-', subscription().displayName, parameters('ALZNotificationAssetSuffix'))]", "location": "Global", "tags": { "_deployed_by_amba": true @@ -385,10 +419,10 @@ "condition": "[[empty(parameters('BYOAlertProcessingRule'))]", "type": "Microsoft.AlertsManagement/actionRules", "apiVersion": "2021-08-08", - "name": "[[concat('apr-AMBA-',subscription().displayName, '-001')]", + "name": "[[concat('apr-AMBA-',subscription().displayName, parameters('ALZNotificationAssetSuffix'))]", "location": "Global", "dependsOn": [ - "[[concat('ag-AMBA-', subscription().displayName, '-001')]" + "[[concat('ag-AMBA-', subscription().displayName, parameters('ALZNotificationAssetSuffix'))]" ], "tags": { "_deployed_by_amba": true @@ -397,11 +431,18 @@ "scopes": [ "[[subscription().Id]" ], - "description": "AMBA Notification Assets - Alert Processing Rule for Subscription", + "description": "[[concat('AMBA Notification Assets - Alert Processing Rule for Subscription', parameters('ALZNotificationAssetSuffix'))]", + "conditions": [ + { + "field": "severity", + "operator": "Equals", + "values": "[[parameters('ALZAlertSeverity')]" + } + ], "enabled": true, "actions": [ { - "actiongroupIds": "[[if(empty(parameters('BYOActionGroup')), array(concat(subscription().Id, '/resourceGroups/', parameters('ALZMonitorResourceGroupName'), '/providers/microsoft.insights/actionGroups/', 'ag-AMBA-', subscription().displayName, '-001')), variables('varAGIds'))]", + "actiongroupIds": "[[if(empty(parameters('BYOActionGroup')), array(concat(subscription().Id, '/resourceGroups/', parameters('ALZMonitorResourceGroupName'), '/providers/microsoft.insights/actionGroups/', 'ag-AMBA-', subscription().displayName, parameters('ALZNotificationAssetSuffix'))), variables('varAGIds'))]", "actionType": "AddActionGroups" } ] @@ -437,6 +478,12 @@ "ALZFunctionTriggerUrl": { "value": "[[parameters('ALZFunctionTriggerUrl')]" }, + "ALZNotificationAssetSuffix":{ + "value": "[[parameters('ALZNotificationAssetSuffix')]" + }, + "ALZAlertSeverity": { + "value": "[[parameters('ALZAlertSeverity')]" + }, "BYOActionGroup": { "value": "[[parameters('BYOActionGroup')]" }, @@ -482,6 +529,12 @@ "ALZFunctionTriggerUrl": { "value": "[[parameters('ALZFunctionTriggerUrl')]" }, + "ALZNotificationAssetSuffix":{ + "value": "[[parameters('ALZNotificationAssetSuffix')]" + }, + "ALZAlertSeverity": { + "value": "[[parameters('ALZAlertSeverity')]" + }, "BYOActionGroup": { "value": "[[parameters('BYOActionGroup')]" }, diff --git a/services/AlertsManagement/actionRules/Deploy-AlertProcessingRule-Suppression.json b/services/AlertsManagement/actionRules/Deploy-AlertProcessingRule-Suppression.json index a9be7976d..63a74a591 100644 --- a/services/AlertsManagement/actionRules/Deploy-AlertProcessingRule-Suppression.json +++ b/services/AlertsManagement/actionRules/Deploy-AlertProcessingRule-Suppression.json @@ -146,7 +146,7 @@ { "type": "Microsoft.AlertsManagement/actionRules", "apiVersion": "2021-08-08", - "name": "[[concat('apr-AMBA-',subscription().displayName, '-002')]", + "name": "[[concat('apr-AMBA-',subscription().displayName, '-S001')]", "location": "Global", "dependsOn": [], "tags": {