Skip to content

Instantly share code, notes, and snippets.

@frandi
Last active October 18, 2021 02:39
Show Gist options
  • Save frandi/3a2039981d6f17c968c8f1a02e9db102 to your computer and use it in GitHub Desktop.
Save frandi/3a2039981d6f17c968c8f1a02e9db102 to your computer and use it in GitHub Desktop.
Azure Bicep
param productName string
param environmentName string
resource appInsights 'Microsoft.Insights/components@2020-02-02' = {
name: '${productName}-insights-${environmentName}'
location: resourceGroup().location
kind: 'web'
properties: {
Application_Type: 'web'
WorkspaceResourceId: logAnalyticsWorkspace.id
}
tags: {
'environment': environmentName
}
}
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-06-01' = {
name: '${productName}-log-analytics-${environmentName}'
location: resourceGroup().location
properties: {
sku: {
name: 'PerGB2018'
}
retentionInDays: 120
}
tags: {
'environment': environmentName
}
}
output instrumentationKey string = appInsights.properties.InstrumentationKey
output connectionString string = appInsights.properties.ConnectionString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment