Recently I had to update a bunch of Log Analytics Workspaces resources to enable the Container Monitoring Solution. So I came up with this ARM Template that I want to share with you:
1{
2 "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3 "contentVersion": "1.0.0.0",
4 "parameters": {
5 "LogAnalyticsWorkspaceName": {
6 "type": "string",
7 "metadata": {
8 "description": "Log Analytics Workspace name"
9 }
10 }
11 },
12 "variables": {
13 "workspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces/', parameters('LogAnalyticsWorkspaceName'))]",
14 "containerSolutionName": "[concat(parameters('LogAnalyticsWorkspaceName'), '-containers')]"
15 },
16 "resources": [
17 {
18 "type": "Microsoft.OperationsManagement/solutions",
19 "apiVersion": "2015-11-01-preview",
20 "name": "[variables('containerSolutionName')]",
21 "location": "[resourceGroup().location]",
22 "plan": {
23 "name": "[variables('containerSolutionName')]",
24 "product": "[concat('OMSGallery/', 'ContainerInsights')]",
25 "promotionCode": "",
26 "publisher": "Microsoft"
27 },
28 "properties": {
29 "workspaceResourceId": "[variables('workspaceResourceId')]"
30 }
31 }
32 ],
33 "outputs": {}
34}
Hope it helps!
Comments