-
Notifications
You must be signed in to change notification settings - Fork 1
/
appInsights.bicep
45 lines (39 loc) · 1.05 KB
/
appInsights.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
param name string
param suffix string = ''
param location string = resourceGroup().location
@allowed([
'web'
'other'
])
param appInsightsType string = 'web'
@allowed([
'ApplicationInsights'
'ApplicationInsightsWithDiagnosticSettings'
'LogAnalytics'
])
param appInsightsIngestionMode string = 'LogAnalytics'
param workspaceId string
var workspace = {
id: workspaceId
}
var appInsights = {
name: 'appins-${name}${(suffix == '' ? '' : '-${suffix}')}'
location: location
appType: appInsightsType
ingestionMode: appInsightsIngestionMode
}
resource appins 'Microsoft.Insights/components@2020-02-02' = {
name: appInsights.name
location: appInsights.location
kind: 'web'
properties: {
Application_Type: appInsights.appType
Flow_Type: 'Bluefield'
IngestionMode: appInsights.ingestionMode
Request_Source: 'rest'
WorkspaceResourceId: workspace.id
}
}
output id string = appins.id
output name string = appins.name
output instrumentationKey string = appins.properties.InstrumentationKey