-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved app insights and diag settings for frontend
into its own module Jira ticket: CAMS-417
- Loading branch information
1 parent
4ea7609
commit 2f681f6
Showing
5 changed files
with
114 additions
and
81 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
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
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
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
72 changes: 72 additions & 0 deletions
72
ops/cloud-deployment/lib/app-insights/webapp-insights.bicep
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,72 @@ | ||
param webappName string | ||
|
||
param analyticsWorkspaceId string | ||
|
||
param createAlerts bool | ||
|
||
param createApplicationInsights bool | ||
|
||
param actionGroupName string | ||
|
||
param actionGroupResourceGroupName string | ||
|
||
resource webapp 'Microsoft.Web/sites@2023-12-01' existing = { | ||
name: webappName | ||
} | ||
|
||
module appInsights './app-insights.bicep' = if (createApplicationInsights) { | ||
name: '${webappName}-application-insights-module' | ||
params: { | ||
location: webapp.location | ||
kind: 'web' | ||
appInsightsName: 'appi-${webappName}' | ||
applicationType: 'web' | ||
workspaceResourceId: analyticsWorkspaceId | ||
} | ||
} | ||
|
||
module diagnosticSettings './diagnostics-settings-webapp.bicep' = if (createApplicationInsights) { | ||
name: '${webappName}-diagnostic-settings-module' | ||
params: { | ||
webappName: webappName | ||
workspaceResourceId: analyticsWorkspaceId | ||
} | ||
dependsOn: [ | ||
appInsights | ||
webapp | ||
] | ||
} | ||
|
||
module healthAlertRule '../monitoring-alerts/metrics-alert-rule.bicep' = if (createAlerts) { | ||
name: '${webappName}-healthcheck-alert-rule-module' | ||
params: { | ||
alertName: '${webappName}-health-check-alert' | ||
appId: webapp.id | ||
timeAggregation: 'Average' | ||
operator: 'LessThan' | ||
targetResourceType: 'Microsoft.Web/sites' | ||
metricName: 'HealthCheckStatus' | ||
severity: 2 | ||
threshold: 100 | ||
actionGroupName: actionGroupName | ||
actionGroupResourceGroupName: actionGroupResourceGroupName | ||
} | ||
} | ||
|
||
module httpAlertRule '../monitoring-alerts/metrics-alert-rule.bicep' = if (createAlerts) { | ||
name: '${webappName}-http-error-alert-rule-module' | ||
params: { | ||
alertName: '${webappName}-http-error-alert' | ||
appId: webapp.id | ||
timeAggregation: 'Total' | ||
operator: 'GreaterThanOrEqual' | ||
targetResourceType: 'Microsoft.Web/sites' | ||
metricName: 'Http5xx' | ||
severity: 1 | ||
threshold: 1 | ||
actionGroupName: actionGroupName | ||
actionGroupResourceGroupName: actionGroupResourceGroupName | ||
} | ||
} | ||
|
||
output connectionString string = appInsights.outputs.connectionString |