diff --git a/infrastructure/deployment.json b/infrastructure/deployment.json index 667d83bf..91885419 100644 --- a/infrastructure/deployment.json +++ b/infrastructure/deployment.json @@ -37,6 +37,13 @@ "description": "The pricing tier for the App Service plan" } }, + "WorkspaceName": { + "type": "string", + "defaultValue": "[format('worksp-{0}', guid(resourceGroup().id))]", + "metadata": { + "description": "The name of the Log Analytics Workspace resource" + } + }, "ApplicationInsightsName": { "type": "string", "defaultValue": "[format('appins-{0}', guid(resourceGroup().id))]", @@ -516,6 +523,18 @@ "[resourceId('Microsoft.Search/searchServices', parameters('AzureSearchService'))]" ] }, + { + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2020-08-01", + "name": "[parameters('WorkspaceName')]", + "location": "[resourceGroup().location]", + "properties": { + "sku": { + "name": "PerGB2018" + }, + "retentionInDays": 30 + } + }, { "type": "Microsoft.Insights/components", "apiVersion": "2020-02-02", @@ -525,9 +544,13 @@ "[format('hidden-link:{0}', resourceId('Microsoft.Web/sites', parameters('ApplicationInsightsName')))]": "Resource" }, "properties": { - "Application_Type": "web" + "Application_Type": "web", + "WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('WorkspaceName'))]" }, - "kind": "web" + "kind": "web", + "dependsOn": [ + "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('WorkspaceName'))]" + ] }, { "type": "Microsoft.DocumentDB/databaseAccounts",