Skip to content

Instantly share code, notes, and snippets.

@bgelens
Last active January 10, 2019 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgelens/22f12585eb508e5d641c66d7e481b7c1 to your computer and use it in GitHub Desktop.
Save bgelens/22f12585eb508e5d641c66d7e481b7c1 to your computer and use it in GitHub Desktop.
arm template to deploy pre-compiled nodeConfigurations to Azure Automation DSC
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"automationAccountName": {
"type": "string",
"metadata": {
"description": "The name of the automation account."
}
},
"configurationName": {
"type": "string",
"metadata": {
"description": "The name of the configuration. Will be used as first part of node configuration name."
}
},
"mofContent": {
"type": "string",
"metadata": {
"description": "MOF file content. cat .\\localhost.mof -Raw).ToString()"
}
},
"roleName": {
"type": "string",
"metadata": {
"description": "The name implied Server Role. Will be used as second part of node configuration name."
}
}
},
"variables": {},
"resources": [
{
"name": "[concat(parameters('automationAccountName'), '/', parameters('configurationName'))]",
"type": "Microsoft.Automation/automationAccounts/configurations",
"apiVersion": "2018-01-15",
"location": "[resourceGroup().location]",
"dependsOn": [],
"properties": {
"state": "Published",
"overwrite": "true",
"source": {
"type": "embeddedContent",
"value": "[concat('configuration ', parameters('configurationName'), '{}')]"
}
}
},
{
"name": "[concat(parameters('automationAccountName'), '/', parameters('configurationName'), '.', parameters('roleName'))]",
"type": "Microsoft.Automation/automationAccounts/nodeConfigurations",
"apiVersion": "2018-01-15",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Automation/automationAccounts/', parameters('automationAccountName'), '/configurations/', parameters('configurationName'))]"
],
"properties": {
"name": "[concat(parameters('configurationName'), '.', parameters('roleName'))]",
"configuration":{
"name": "[concat(parameters('configurationName'))]"
},
"incrementNodeConfigurationBuild": false,
"source":{
"type": "embeddedContent",
"value": "[parameters('mofContent')]"
}
}
}
],
"outputs": {}
}
@escogom
Copy link

escogom commented Jan 10, 2019

Is there are parameters json file tied to this one? I'm interested in seeing what you have for 'mofContent'. I currently have an mof I can see in azure portal -> automation account -> etc... but I can't seem to get the right source property in the nodeConfigurations resource :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment