Skip to content

Commit

Permalink
move application insights from classic to workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
hmeiland committed Jul 10, 2024
1 parent 130320f commit 436bcad
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
16 changes: 16 additions & 0 deletions deploy/amlhpc_simple.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var tenantId = subscription().tenantId
var storageAccountName = substring('st${name}${resourcePostfix}',0,20)
var keyVaultName = substring('kv${name}${resourcePostfix}',0,20)
var applicationInsightsName = substring('ai${name}${resourcePostfix}',0,20)
var logAnalyticsName = substring('la${name}${resourcePostfix}',0,20)
var containerRegistryName = substring('cr${name}${resourcePostfix}',0,20)
var workspaceName = substring('ml${name}${resourcePostfix}',0,20)
var virtualNetworkName = substring('vn${name}${resourcePostfix}',0,20)
Expand Down Expand Up @@ -57,12 +58,27 @@ resource vault 'Microsoft.KeyVault/vaults@2022-07-01' = {
}
}

resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = {
name: logAnalyticsName
location: location
properties: {
sku: {
name: 'PerGB2018'
}
retentionInDays: 90
workspaceCapping: {
dailyQuotaGb: '0.023'
}
}
}

resource applicationInsight 'Microsoft.Insights/components@2020-02-02' = {
name: applicationInsightsName
location: location
kind: 'web'
properties: {
Application_Type: 'web'
WorkspaceResourceId: logAnalyticsWorkspace.id
}
}

Expand Down
28 changes: 24 additions & 4 deletions deploy/amlhpc_simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "1201384740295974037"
"version": "0.28.1.47646",
"templateHash": "15994311308947372117"
}
},
"parameters": {
Expand All @@ -23,6 +23,7 @@
"storageAccountName": "[substring(format('st{0}{1}', parameters('name'), variables('resourcePostfix')), 0, 20)]",
"keyVaultName": "[substring(format('kv{0}{1}', parameters('name'), variables('resourcePostfix')), 0, 20)]",
"applicationInsightsName": "[substring(format('ai{0}{1}', parameters('name'), variables('resourcePostfix')), 0, 20)]",
"logAnalyticsName": "[substring(format('la{0}{1}', parameters('name'), variables('resourcePostfix')), 0, 20)]",
"containerRegistryName": "[substring(format('cr{0}{1}', parameters('name'), variables('resourcePostfix')), 0, 20)]",
"workspaceName": "[substring(format('ml{0}{1}', parameters('name'), variables('resourcePostfix')), 0, 20)]",
"virtualNetworkName": "[substring(format('vn{0}{1}', parameters('name'), variables('resourcePostfix')), 0, 20)]",
Expand Down Expand Up @@ -77,15 +78,34 @@
"enableSoftDelete": true
}
},
{
"type": "Microsoft.OperationalInsights/workspaces",
"apiVersion": "2021-12-01-preview",
"name": "[variables('logAnalyticsName')]",
"location": "[variables('location')]",
"properties": {
"sku": {
"name": "PerGB2018"
},
"retentionInDays": 90,
"workspaceCapping": {
"dailyQuotaGb": "0.023"
}
}
},
{
"type": "Microsoft.Insights/components",
"apiVersion": "2020-02-02",
"name": "[variables('applicationInsightsName')]",
"location": "[variables('location')]",
"kind": "web",
"properties": {
"Application_Type": "web"
}
"Application_Type": "web",
"WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('logAnalyticsName'))]"
},
"dependsOn": [
"[resourceId('Microsoft.OperationalInsights/workspaces', variables('logAnalyticsName'))]"
]
},
{
"type": "Microsoft.ContainerRegistry/registries",
Expand Down

0 comments on commit 436bcad

Please sign in to comment.