0

I need to deploy an Azure automation account to my resource group. This to add the module (start/stop VM's during off hours solution to my environment) For the automation account I succesfully used the following template. But to add the module I only found the gui solution through the portal.

The only way I found ATM is to create the module in the portal, find the runbooks that are begin created and create the exact same runbooks through an arm template with my Automation account template. But that doesn't seems to be very efficient. Is there anyone who already deployed this in an ARM template or can help me guide me in the right direction that would be awesome.

4c74356b41
  • 628
  • 5
  • 10
achahbar
  • 111
  • 1
  • https://docs.microsoft.com/es-es/azure/templates/Microsoft.Automation/2015-10-31/automationAccounts/modules – 4c74356b41 Nov 16 '18 at 08:55

2 Answers2

1

For anyone that got here by searching the same thing as me i got a solution in this repo https://github.com/Microsoft/MSITARM/tree/master/ARO-Toolkit-Marketplace

Enjoy

achahbar
  • 111
  • 1
0

Use 2 variables, 1 for the name of the module and 1 for the URI to the module "xDSCDomainjoin:1.1.0:Name": "xDSCDomainjoin", "xDSCDomainjoin:1.1.0:Uri":"https://devopsgallerystorage.blob.core.windows.net/packages/xdscdomainjoin.1.1.0.nupkg"

And then use this snippet of an ARM template, note the dependOn parameter which should point to you automation account.

{
"name": "[parameters('xDSCDomainjoin:1.1.0:Name')]",
"type": "modules",
"apiVersion": "2015-10-31",
"location": "[parameters('accountLocation')]",
"dependsOn": [
    "[concat('Microsoft.Automation/automationAccounts/', parameters('accountName'))]"
],
"tags": {},
"properties": {
    "contentLink": {
        "uri": "[parameters('xDSCDomainjoin:1.1.0:Uri')]"
    }
}

}

Jarnstrom
  • 705
  • 4
  • 9