JSON
Copy definition Copy definition 4 EPAC EPAC
{ 7 items policyType: "Custom" , mode: "All" , displayName: "Deploy Azure Monitor Baseline Alerts (AMBA-ALZ) - Service Health Advisory Alert" , description: "Policy to audit/deploy Service Health Advisory Alert" , metadata: { 5 items version: "1.4.0" , category: "Monitoring" , source: "https://github.com/Azure/azure-monitor-baseline-alerts/" , alzCloudEnvironments: [ 1 item ] , _deployed_by_amba: "True" } , parameters: { 9 items enabled: { 4 items } , alertResourceGroupName: { 3 items type: "String" , metadata: { 2 items displayName: "Resource Group Name" , description: "Resource group the alert is placed in" } , defaultValue: "rg-amba-monitoring-001" } , alertResourceGroupTags: { 3 items } , alertResourceGroupLocation: { 3 items type: "String" , metadata: { 2 items displayName: "Resource Group Location" , description: "Location of the Resource group the alert is placed in" } , defaultValue: "centralus" } , effect: { 4 items } , MonitorDisableTagName: { 3 items type: "String" , metadata: { 2 items displayName: "ALZ Monitoring disabled tag name" , description: "Tag name to disable monitoring. Set to true if monitoring should be disabled" } , defaultValue: "MonitorDisable" } , MonitorDisableTagValues: { 3 items type: "Array" , metadata: { 2 items displayName: "ALZ Monitoring disabled tag values(s)" , description: "Tag value(s) used to disable monitoring at the resource level. Set to true if monitoring should be disabled." } , defaultValue: [ 4 items "true" , "Test" , "Dev" , "Sandbox" ] } , ALZMonitorActionGroupEmail: { 3 items type: "Array" , metadata: { 2 items displayName: "Action Group Email Addresses" , description: "Email addresses to send alerts to" } , defaultValue : [] } , BYOActionGroup: { 3 items type: "array" , metadata: { 2 items displayName: "Customer defined Action Group Resource IDs" , description: "The Resource IDs of existing Action Groups currently deployed in the environment." } , defaultValue : [] } } , policyRule: { 2 items if: { 1 item allOf: [ 2 items { 2 items field: "type" , equals: "Microsoft.Resources/subscriptions" } , { 2 items field: "[
concat(
'tags[
',
parameters('MonitorDisableTagName'),
'
]'
)
]" , notIn: "[parameters('MonitorDisableTagValues')]" } ] } , then: { 2 items effect: "[parameters('effect')]" , details: { 7 items roleDefinitionIds: [ 1 item "/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c" Contributor ] , type: "Microsoft.Insights/activityLogAlerts" , existenceScope: "resourceGroup" , resourceGroupName: "[parameters('alertResourceGroupName')]" , deploymentScope: "subscription" , existenceCondition: { 1 item } , deployment: { 2 items location: "northeurope" , properties: { 3 items mode: "incremental" , template: { 5 items $schema: "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#" , contentVersion: "1.0.0.0" , parameters: { 6 items } , variables: { 1 item copy: [ 1 item { 4 items name: "varActionGroupIds" , count: "[
length(
parameters('BYOActionGroup')
)
]" , mode: "serial" , input: { 1 item actionGroupId: "[
trim(
parameters('BYOActionGroup')[
copyIndex(
'varActionGroupIds'
)
]
)
]" } } ] } , resources: [ 2 items { 5 items type: "Microsoft.Resources/resourceGroups" , apiVersion: "2021-04-01" , name: "[parameters('alertResourceGroupName')]" , location: "[parameters('alertResourceGroupLocation')]" , tags: "[parameters('alertResourceGroupTags')]" } , { 6 items type: "Microsoft.Resources/deployments" , apiVersion: "2019-10-01" , name: "ServiceHealthHealth" , resourceGroup: "[parameters('alertResourceGroupName')]" , dependsOn: [ 1 item 🔍 "[
resourceId(
'Microsoft.Resources/resourceGroups',
parameters('alertResourceGroupName')
)
]"] , properties: { 3 items mode: "Incremental" , template: { 5 items $schema: "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" , contentVersion: "1.0.0.0" , parameters: { 4 items } , variables : {} , resources: [ 1 item { 6 items type: "microsoft.insights/activityLogAlerts" , apiVersion: "2020-10-01" , name: "ServiceHealthAdvisoryEvent" , location: "Global" , tags: { 1 item } , properties: { 6 items actions: { 1 item actionGroups: "[
if(
empty(
parameters('BYOActionGroup')
),
array(
createObject(
'actionGroupId',
concat(
subscription().Id,
'/resourceGroups/',
parameters('alertResourceGroupName'),
'/providers/microsoft.insights/actionGroups/',
'ag-AMBA-SH-',
subscription().displayName,
'-001'
)
)
),
variables(
'varActionGroupIds'
)
)
]" } , description: "Service Health Advisory Alert" , enabled: "[parameters('enabled')]" , scopes: [ 1 item ] , condition: { 1 item } , parameters: { 1 item } } } ] } , parameters: { 4 items } } } ] } , parameters: { 6 items } } } } } } }