-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure Logic App to send Azure Alerts to Azure (#44)
- Loading branch information
1 parent
6f97170
commit 52b6913
Showing
3 changed files
with
137 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
targetScope = 'subscription' | ||
|
||
@allowed([ 'dev', 'prd' ]) | ||
@allowed(['dev', 'prd']) | ||
param environment string | ||
|
||
var location = 'West Europe' | ||
|
@@ -47,3 +47,21 @@ module alertLogicApp 'modules/alert-logicapp.bicep' = { | |
environment: environment | ||
} | ||
} | ||
|
||
module actionGroup 'modules/actiongroup.bicep' = { | ||
name: '${deployment().name}-actiongroup' | ||
scope: sharedRg | ||
params: { | ||
organizationPrefix: organizationPrefix | ||
sharedResourcesAbbreviation: sharedResourcesAbbreviation | ||
environment: environment | ||
emailReceivers: ['[email protected]'] | ||
logicAppReceivers: [ | ||
{ | ||
name: alertLogicApp.outputs.logicAppName | ||
resourceId: alertLogicApp.outputs.logicAppResourceId | ||
useCommonAlertSchema: true | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@allowed(['dev', 'prd']) | ||
param environment string | ||
|
||
param organizationPrefix string | ||
param sharedResourcesAbbreviation string | ||
|
||
param groupShortName string = 'IO Devs' | ||
param emailReceivers array | ||
param logicAppReceivers array | ||
|
||
resource actiongroup 'Microsoft.Insights/actionGroups@2023-01-01' = { | ||
name: 'ag-${organizationPrefix}-${sharedResourcesAbbreviation}-${environment}' | ||
location: 'Global' | ||
properties: { | ||
groupShortName: groupShortName | ||
enabled: true | ||
emailReceivers: [ | ||
for email in emailReceivers: { | ||
name: email | ||
emailAddress: email | ||
useCommonAlertSchema: true | ||
} | ||
] | ||
logicAppReceivers: [ | ||
for app in logicAppReceivers: { | ||
name: app.name | ||
resourceId: app.ResourceId | ||
callbackUrl: listCallbackUrl(app.ResourceId, '2019-05-01').value | ||
useCommonAlertSchema: app.UseCommonAlertSchema | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters