Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
94 lines (93 sloc) 3.34 KB
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspaceName": {
"type": "string",
"metadata": {
"description": "Log Analytics workspace name"
}
},
"serviceTier": {
"type": "string",
"defaultValue": "Free",
"allowedValues": [
"Free",
"Standalone",
"PerNode"
],
"metadata": {
"description": "Log Analytics service tier: Free, Standalone, or PerNode"
}
},
"dataRetention": {
"type": "int",
"defaultValue": 7,
"minValue": 7,
"maxValue": 730,
"metadata": {
"description": "Log Analytics number of days of retention. Free plans can only have 7 days, Standalone and OMS plans include 30 days for free"
}
}
},
"variables": {
"apiVersion": {
"logAnalytics": "2017-03-15-preview",
"logAnalyticsSolutions": "2015-11-01-preview"
},
"container": {
"name": "[concat('Containers', '(', parameters('workspaceName'), ')')]",
"galleryName": "Containers"
},
"logAnalyticsConfiguration": {
"workspaceName": "[parameters('workspaceName')]",
"serviceTier": "[parameters('serviceTier')]",
"dataRetention": "[parameters('dataRetention')]"
}
},
"resources": [
{
"apiVersion": "[variables('apiVersion').logAnalytics]",
"type": "Microsoft.OperationalInsights/workspaces",
"name": "[variables('logAnalyticsConfiguration').workspaceName]",
"location": "[resourceGroup().location]",
"properties": {
"sku": {
"Name": "[variables('logAnalyticsConfiguration').serviceTier]"
},
"retention": "[variables('logAnalyticsConfiguration').dataRetention]"
},
"resources": [
{
"apiVersion": "[variables('apiVersion').logAnalyticsSolutions]",
"location": "[resourceGroup().location]",
"name": "[variables('container').name]",
"type": "Microsoft.OperationsManagement/solutions",
"id": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.OperationsManagement/solutions/', variables('container').name)]",
"dependsOn": [
"[concat('Microsoft.OperationalInsights/workspaces/', variables('logAnalyticsConfiguration').workspaceName)]"
],
"properties": {
"workspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces/', variables('logAnalyticsConfiguration').workspaceName)]"
},
"plan": {
"name": "[variables('container').name]",
"publisher": "Microsoft",
"promotionCode": "",
"product": "[concat('OMSGallery/', variables('container').galleryName)]"
}
}
]
}
],
"outputs": {
"workspaceId": {
"type": "string",
"value": "[reference(concat('Microsoft.OperationalInsights/workspaces/', variables('logAnalyticsConfiguration').workspaceName), variables('apiVersion').logAnalytics).customerId]"
},
"primaryKey": {
"type": "string",
"value": "[listKeys(resourceId('Microsoft.OperationalInsights/workspaces/', variables('logAnalyticsConfiguration').workspaceName), variables('apiVersion').logAnalytics).primarySharedKey]"
}
}
}