powershellazureazure-resource-managerpowershell-dsc

Apply multiple DSCs through Azure Resource Manager


Is it possible to apply multiple DSC configurations to one vm through Azure Resource Manager?

Currently I am using something like this:

    {
      "apiVersion": "2015-06-15",
      "dependsOn": [
        "[concat('Microsoft.Compute/virtualMachines/', variables('vm_name'))]"
      ],
      "location": "[resourceGroup().location]",
      "name": "DSCSetup",
      "properties": {
        "publisher": "Microsoft.Powershell",
        "type": "DSC",
        "typeHandlerVersion": "2.20",
        "autoUpgradeMinorVersion": true,
        "settings": {
          "modulesUrl": "[concat('https://', variables('sa_name'), '.blob.core.windows.net/.../dsc.ps1.zip')]",
          "configurationFunction": "dsc.ps1\\Main",
          "properties": {
            "MachineName": "[variables('vm_name')]",
            "UserName": "[parameters('vm_user')]"
          }
        },
        "protectedSettings": {}
      },
      "type": "extensions"
    }

If not, can you merge multiple DSCs automatically?

Scenario is:


Solution

  • DSC only allows for a single configuration at the moment, so if you deployed 2 DSC extensions to the same VM (I'm not sure it will actually work) the second config would overwrite the first.

    You could probably stack DSC and CustomScript but since DSC can run script, I'm not sure why you'd ever need to do that...

    What's your scenario?