-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapplication-insights.bicep
35 lines (31 loc) · 1.45 KB
/
application-insights.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
@description('Name of the resource.')
param name string
@description('Location to deploy the resource. Defaults to the location of the resource group.')
param location string = resourceGroup().location
@description('Tags for the resource.')
param tags object = {}
@description('Name for the Log Analytics Workspace resource associated with the Application Insights instance.')
param logAnalyticsWorkspaceName string
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' existing = {
name: logAnalyticsWorkspaceName
}
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
name: name
location: location
tags: tags
kind: 'web'
properties: {
Application_Type: 'web'
WorkspaceResourceId: logAnalyticsWorkspace.id
}
}
@description('The deployed Application Insights resource.')
output resource resource = applicationInsights
@description('ID for the deployed Application Insights resource.')
output id string = applicationInsights.id
@description('Name for the deployed Application Insights resource.')
output name string = applicationInsights.name
@description('Instrumentation Key for the deployed Application Insights resource.')
output instrumentationKey string = applicationInsights.properties.InstrumentationKey
@description('Connection string for the deployed Application Insights resource.')
output connectionString string = applicationInsights.properties.ConnectionString