Created
October 3, 2017 09:34
-
-
Save krnese/a6018ee3784c2b0da80c581d8d4ddcd3 to your computer and use it in GitHub Desktop.
OMS + DSC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "Microsoft.Compute/virtualMachines/extensions", | |
"apiVersion": "2017-03-30", | |
"name": "[concat(parameters('vmNamePrefix'), parameters('platform'), copyIndex(), '/OMS')]", | |
"location": "[resourceGroup().location]", | |
"copy": { | |
"name": "[concat(parameters('vmNamePrefix'), parameters('platform'), 'OMS')]", | |
"count": "[parameters('instanceCount')]" | |
}, | |
"dependsOn": [ | |
"[concat('Microsoft.Compute/virtualMachines/', parameters('vmNamePrefix'), parameters('platform'), copyIndex())]" | |
], | |
"properties": { | |
"publisher": "Microsoft.EnterpriseCloud.Monitoring", | |
"type": "[if(equals(parameters('platform'), 'WinSrv'), variables('windowsMgmtType'), variables('linuxMgmtType'))]", | |
"typeHandlerVersion": "[if(equals(parameters('platform'), 'WinSrv'), variables('windowsMgmtVersion'), variables('linuxMgmtVersion'))]", | |
"autoUpgradeMinorVersion": true, | |
"settings": { | |
"workspaceId": "[reference(resourceId(parameters('omsResourceGroup'), 'Microsoft.OperationalInsights/workspaces/', parameters('omsWorkspaceName')), '2015-11-01-preview').customerId]", | |
"azureResourceId": "[resourceId('Microsoft.Compute/virtualMachines/', concat(parameters('vmNamePrefix'), parameters('platform'), copyIndex()))]" | |
}, | |
"protectedSettings": { | |
"workspaceKey": "[listKeys(resourceId(parameters('omsResourceGroup'),'Microsoft.OperationalInsights/workspaces/', parameters('omsWorkspaceName')), '2015-11-01-preview').primarySharedKey]" | |
} | |
} | |
}, | |
{ | |
"type": "Microsoft.Compute/virtualMachines/extensions", | |
"name": "[concat(parameters('vmNamePrefix'), parameters('platform'), copyIndex(), '/ServiceMap')]", | |
"apiVersion": "2017-03-30", | |
"location": "[resourceGroup().location]", | |
"copy": { | |
"name": "[concat(parameters('vmNamePrefix'), parameters('platform'), 'ServiceMap')]", | |
"count": "[parameters('instanceCount')]" | |
}, | |
"dependsOn": [ | |
"[concat('Microsoft.Compute/virtualMachines/', parameters('vmNamePrefix'), parameters('platform'), copyIndex(), '/extensions/', '/OMS')]" | |
], | |
"properties": { | |
"publisher": "Microsoft.Azure.Monitoring.DependencyAgent", | |
"type": "[if(equals(parameters('platform'), 'WinSrv'), 'DependencyAgentWindows', 'DependencyAgentLinux')]", | |
"typeHandlerVersion": "9.1", | |
"autoUpgradeMinorVersion": true | |
} | |
}, | |
{ | |
"condition": "[equals(parameters('platform'), 'WinSrv')]", | |
"type": "Microsoft.Compute/virtualMachines/extensions", | |
"name": "[concat(parameters('vmNamePrefix'), parameters('platform'), copyIndex(), '/DSC')]", | |
"apiVersion": "2017-03-30", | |
"location": "[resourceGroup().location]", | |
"copy": { | |
"name": "[concat(parameters('vmNamePrefix'), parameters('platform'), 'DSC')]", | |
"count": "[parameters('instanceCount')]" | |
}, | |
"dependsOn": [ | |
"[concat('Microsoft.Compute/virtualMachines/', parameters('vmNamePrefix'), parameters('platform'), copyIndex())]" | |
], | |
"properties": { | |
"publisher": "Microsoft.Powershell", | |
"type": "DSC", | |
"typeHandlerVersion": "2.19", | |
"autoUpgradeMinorVersion": true, | |
"protectedSettings": { | |
"Items": { | |
"registrationKeyPrivate": "[listKeys(resourceId(parameters('omsResourceGroup'), 'Microsoft.Automation/automationAccounts/', parameters('automationAccountName')), '2015-01-01-preview').Keys[0].value]" | |
} | |
}, | |
"settings": { | |
"ModulesUrl": "[variables('modulesUrl')]", | |
"SasToken": "", | |
"ConfigurationFunction": "[variables('configurationFunction')]", | |
"Properties": [ | |
{ | |
"Name": "RegistrationKey", | |
"Value": { | |
"UserName": "PLACEHOLDER_DONOTUSE", | |
"Password": "PrivateSettingsRef:registrationKeyPrivate" | |
}, | |
"TypeName": "System.Management.Automation.PSCredential" | |
}, | |
{ | |
"Name": "RegistrationUrl", | |
"Value": "[reference(resourceId(parameters('omsResourceGroup'), 'Microsoft.Automation/automationAccounts/', parameters('automationAccountName')), '2015-01-01-preview').registrationUrl]", | |
"TypeName": "System.String" | |
}, | |
{ | |
"Name": "NodeConfigurationName", | |
"Value": "[variables('configName')]", | |
"TypeName": "System.String" | |
}, | |
{ | |
"Name": "ConfigurationMode", | |
"Value": "[variables('configurationMode')]", | |
"TypeName": "System.String" | |
}, | |
{ | |
"Name": "ConfigurationModeFrequencyMins", | |
"Value": "[variables('configurationModeFrequencyMins')]", | |
"TypeName": "System.Int32" | |
}, | |
{ | |
"Name": "RefreshFrequencyMins", | |
"Value": "[variables('refreshFrequencyMins')]", | |
"TypeName": "System.Int32" | |
}, | |
{ | |
"Name": "RebootNodeIfNeeded", | |
"Value": "[variables('rebootNodeIfNeeded')]", | |
"TypeName": "System.Boolean" | |
}, | |
{ | |
"Name": "ActionAfterReboot", | |
"Value": "[variables('actionAfterReboot')]", | |
"TypeName": "System.String" | |
}, | |
{ | |
"Name": "AllowModuleOverwrite", | |
"Value": "[variables('allowModuleOverwrite')]", | |
"TypeName": "System.Boolean" | |
} | |
] | |
} | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment