Skip to content

Commit

Permalink
Added ARM templates for onboarding VM/VMSS/LA Workspace to Azure Moni…
Browse files Browse the repository at this point in the history
…tor for VMs
  • Loading branch information
nasundar committed Oct 16, 2019
0 parents commit 0125d1f
Show file tree
Hide file tree
Showing 11 changed files with 1,175 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"WorkspaceResourceId": {
"value": "/subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroup>/providers/Microsoft.OperationalInsights/workspaces/<WorkspaceName>"
},
"WorkspaceLocation": {
"value": "<WorkspaceLocation>"
}
}
}
418 changes: 418 additions & 0 deletions OnbordingTemplates/ConfigureWorkspace/ConfigureWorkspaceTemplate.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmResourceId": {
"value": "/subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroup>/providers/Microsoft.Compute/virtualMachines/<VirtualMachineName>"
},
"vmLocation": {
"value": "<VirtualMachineLocation>"
},
"osType": {
"value": "<OSType>"
},
"workspaceResourceId": {
"value": "/subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroup>/providers/Microsoft.OperationalInsights/workspaces/<WorkspaceName>"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"VmResourceId": {
"type": "String",
"metadata": {
"description": "VM Resource ID."
}
},
"VmLocation": {
"type": "String",
"metadata": {
"description": "The Virtual Machine Location."
}
},
"osType": {
"type": "String",
"metadata": {
"description": "OS Type, Example: Linux / Windows"
}
},
"WorkspaceResourceId": {
"type": "String",
"metadata": {
"description": "Workspace Resource ID."
}
}
},
"variables": {
"VmName": "[split(parameters('VmResourceId'),'/')[8]]",
"DaExtensionName": "[if(equals(toLower(parameters('osType')), 'windows'), 'DependencyAgentWindows', 'DependencyAgentLinux')]",
"DaExtensionType": "[if(equals(toLower(parameters('osType')), 'windows'), 'DependencyAgentWindows', 'DependencyAgentLinux')]",
"DaExtensionVersion": "9.5",
"MmaExtensionName": "[if(equals(toLower(parameters('osType')), 'windows'), 'MMAExtension', 'OMSExtension')]",
"MmaExtensionType": "[if(equals(toLower(parameters('osType')), 'windows'), 'MicrosoftMonitoringAgent', 'OmsAgentForLinux')]",
"MmaExtensionVersion": "[if(equals(toLower(parameters('osType')), 'windows'), '1.0', '1.4')]"
},
"resources": [
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2018-10-01",
"name": "[variables('VmName')]",
"location": "[parameters('VmLocation')]",
"resources": [
{
"type": "extensions",
"apiVersion": "2018-10-01",
"name": "[variables('DaExtensionName')]",
"location": "[parameters('VmLocation')]",
"dependsOn": [
"[concat('Microsoft.Compute/VirtualMachines/', variables('VmName'))]"
],
"properties": {
"publisher": "Microsoft.Azure.Monitoring.DependencyAgent",
"type": "[variables('DaExtensionType')]",
"typeHandlerVersion": "[variables('DaExtensionVersion')]",
"autoUpgradeMinorVersion": true
}
},
{
"type": "extensions",
"apiVersion": "2018-10-01",
"name": "[variables('MmaExtensionName')]",
"location": "[parameters('VmLocation')]",
"dependsOn": [
"[concat('Microsoft.Compute/VirtualMachines/', variables('VmName'))]"
],
"properties": {
"publisher": "Microsoft.EnterpriseCloud.Monitoring",
"type": "[variables('MmaExtensionType')]",
"typeHandlerVersion": "[variables('MmaExtensionVersion')]",
"autoUpgradeMinorVersion": "true",
"settings": {
"workspaceId": "[reference(parameters('WorkspaceResourceId'), '2015-03-20').customerId]",
"azureResourceId": "[parameters('VmResourceId')]",
"stopOnMultipleConnections": "true"
},
"protectedSettings": {
"workspaceKey": "[listKeys(parameters('WorkspaceResourceId'), '2015-03-20').primarySharedKey]"
}
}
}
]
}
],
"outputs": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"VmssResourceId": {
"value": "/subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroup>/providers/Microsoft.Compute/virtualMachines/<VirtualMachineScaleSetName>"
},
"VmssLocation": {
"value": "<VirtualMachineScaleSetLocation>"
},
"OsType": {
"value": "<OSType>"
},
"WorkspaceResourceId": {
"value": "/subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroup>/providers/Microsoft.OperationalInsights/workspaces/<WorkspaceName>"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"VmssResourceId": {
"type": "String",
"metadata": {
"description": "VM Resource ID."
}
},
"VmssLocation": {
"type": "String",
"metadata": {
"description": "The Virtual Machine Location."
}
},
"osType": {
"type": "String",
"metadata": {
"description": "OS Type, Example: Linux / Windows"
}
},
"WorkspaceResourceId": {
"type": "String",
"metadata": {
"description": "Workspace Resource ID."
}
}
},
"variables": {
"VmssName": "[split(parameters('VmssResourceId'),'/')[8]]",
"DaExtensionName": "[if(equals(toLower(parameters('osType')), 'windows'), 'DependencyAgentWindows', 'DependencyAgentLinux')]",
"DaExtensionType": "[if(equals(toLower(parameters('osType')), 'windows'), 'DependencyAgentWindows', 'DependencyAgentLinux')]",
"DaExtensionVersion": "9.5",
"MmaExtensionName": "[if(equals(toLower(parameters('osType')), 'windows'), 'MMAExtension', 'OMSExtension')]",
"MmaExtensionType": "[if(equals(toLower(parameters('osType')), 'windows'), 'MicrosoftMonitoringAgent', 'OmsAgentForLinux')]",
"MmaExtensionVersion": "[if(equals(toLower(parameters('osType')), 'windows'), '1.0', '1.4')]"
},
"resources": [
{
"type": "Microsoft.Compute/virtualMachineScaleSets",
"apiVersion": "2018-10-01",
"name": "[variables('VmssName')]",
"location": "[parameters('VmssLocation')]",
"resources": [
{
"type": "extensions",
"apiVersion": "2018-10-01",
"name": "[variables('DaExtensionName')]",
"location": "[parameters('VmssLocation')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachineScaleSets/', variables('VmssName'))]"
],
"properties": {
"publisher": "Microsoft.Azure.Monitoring.DependencyAgent",
"type": "[variables('DaExtensionType')]",
"typeHandlerVersion": "[variables('DaExtensionVersion')]",
"autoUpgradeMinorVersion": true
}
},
{
"type": "extensions",
"apiVersion": "2018-10-01",
"name": "[variables('MmaExtensionName')]",
"location": "[parameters('VmssLocation')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachineScaleSets/', variables('VmssName'))]"
],
"properties": {
"publisher": "Microsoft.EnterpriseCloud.Monitoring",
"type": "[variables('MmaExtensionType')]",
"typeHandlerVersion": "[variables('MmaExtensionVersion')]",
"autoUpgradeMinorVersion": "true",
"settings": {
"workspaceId": "[reference(parameters('WorkspaceResourceId'), '2015-03-20').customerId]",
"azureResourceId": "[parameters('VmssResourceId')]",
"stopOnMultipleConnections": "true"
},
"protectedSettings": {
"workspaceKey": "[listKeys(parameters('WorkspaceResourceId'), '2015-03-20').primarySharedKey]"
}
}
}
]
}
],
"outputs": {}
}
50 changes: 50 additions & 0 deletions OnbordingTemplates/NewVmOnboarding/NewVmOnboardingParameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"value": "<VirtualMachineLocation>"
},
"image": {
"value": {
"publisher": "<ImagePublisher>",
"offer": "<ImageOffer>",
"sku": "<ImageSKU>",
"version": "<ImageVersion>"
}
},
"osType": {
"value": "<OSType>"
},
"networkInterfaceName": {
"value": "<NetworkInterfaceName>"
},
"subnetName": {
"value": "default"
},
"virtualNetworkId": {
"value": "/subscriptions/<SubscriptionId>/<ResourceGroup>/VmBladeTest/providers/Microsoft.Network/virtualNetworks/<VirtualNetworkName>"
},
"workspaceId": {
"value": "/subscriptions/<SubscriptionId>/resourceGroups/<ResourceGroup>/providers/Microsoft.OperationalInsights/workspaces/<WorkspaceName>"
},
"virtualMachineName": {
"value": "<VirtualMachineName>"
},
"virtualMachineRG": {
"value": "<VirtualMachineResourceGroup>"
},
"osDiskType": {
"value": "<OSDiskType>"
},
"virtualMachineSize": {
"value": "<VirtualMachineSize>"
},
"adminUsername": {
"value": "<UserName>"
},
"adminPassword": {
"value": "<Password>"
}
}
}
Loading

0 comments on commit 0125d1f

Please sign in to comment.