Skip to content

Commit 34f1352

Browse files
authored
Merge pull request microsoft#69 from microsoft/jameshotfix1
Added Log Analytics workspace for App Insights
2 parents 891bbbe + 9e6e129 commit 34f1352

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

infrastructure/deployment.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@
3737
"description": "The pricing tier for the App Service plan"
3838
}
3939
},
40+
"WorkspaceName": {
41+
"type": "string",
42+
"defaultValue": "[format('worksp-{0}', guid(resourceGroup().id))]",
43+
"metadata": {
44+
"description": "The name of the Log Analytics Workspace resource"
45+
}
46+
},
4047
"ApplicationInsightsName": {
4148
"type": "string",
4249
"defaultValue": "[format('appins-{0}', guid(resourceGroup().id))]",
@@ -516,6 +523,18 @@
516523
"[resourceId('Microsoft.Search/searchServices', parameters('AzureSearchService'))]"
517524
]
518525
},
526+
{
527+
"type": "Microsoft.OperationalInsights/workspaces",
528+
"apiVersion": "2020-08-01",
529+
"name": "[parameters('WorkspaceName')]",
530+
"location": "[resourceGroup().location]",
531+
"properties": {
532+
"sku": {
533+
"name": "PerGB2018"
534+
},
535+
"retentionInDays": 30
536+
}
537+
},
519538
{
520539
"type": "Microsoft.Insights/components",
521540
"apiVersion": "2020-02-02",
@@ -525,9 +544,13 @@
525544
"[format('hidden-link:{0}', resourceId('Microsoft.Web/sites', parameters('ApplicationInsightsName')))]": "Resource"
526545
},
527546
"properties": {
528-
"Application_Type": "web"
547+
"Application_Type": "web",
548+
"WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('WorkspaceName'))]"
529549
},
530-
"kind": "web"
550+
"kind": "web",
551+
"dependsOn": [
552+
"[resourceId('Microsoft.OperationalInsights/workspaces', parameters('WorkspaceName'))]"
553+
]
531554
},
532555
{
533556
"type": "Microsoft.DocumentDB/databaseAccounts",

0 commit comments

Comments
 (0)