Yeah. The only time I did it with push in a template was by adding the extension as a child resource. You should be able to use it as a standalone resource though. Example code:
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Compute/virtualMachines",
"location": "[resourceGroup().location]",
"name": "[variables('CMPrimaryName')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageaccounts',variables('StorageAccountName'))]",
"[resourceId('Microsoft.Network/networkInterfaces','cmprinif')]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[variables('CMPrimaryVMSize')]"
},
"osProfile": {
"computerName": "[variables('CMPrimaryName')]",
"adminUsername": "[variables('adminUserName')]",
"adminPassword": "[variables('adminPassword')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('imagePublisher')]",
"offer": "[variables('imageOffer')]",
"sku": "[variables('WindowsOSVersion')]",
"version": "latest"
},
"osDisk": {
"name": "[concat(variables('CMPrimaryName'),'-osdisk')]",
"vhd": {
"uri": "[concat('http://',variables('StorageAccountName'),'.blob.core.windows.net/vhds/',variables('CMPrimaryName'),'-osdisk.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
},
"dataDisks": [
{
"name": "[concat(variables('CMPrimaryName'),'-data-disk1.vhd')]",
"vhd": {
"uri": "[concat('http://',variables('StorageAccountName'),'.blob.core.windows.net/vhds/',variables('CMPrimaryName'),'-data-disk1.vhd')]"
},
"caching": "None",
"createOption": "Empty",
"diskSizeGB": "1000",
"lun": 0
}
]
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces','cmprinif')]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[concat('http://',variables('StorageAccountName'),'.blob.core.windows.net')]"
}
}
},
"resources": [
{
"type": "extensions",
"apiVersion": "2015-05-01-preview",
"name": "[concat(variables('CMPrimaryName'),'domainjoin')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines',variables('CMPrimaryName'))]",
"[resourceId('Microsoft.Compute/virtualMachines',variables('DCVMName'))]"
],
"properties": {
"publisher": "Microsoft.PowerShell",
"type": "DSC",
"typeHandlerVersion": "2.8",
"settings": {
"ModulesUrl": "[concat(variables('ADAssetLocation'),'/Configuration.zip')]",
"ConfigurationFunction": "Configuration.ps1\\DomainJoin",
"Properties": {
"DomainName": "[variables('ADDomainName')]",
"AdminCreds": {
"UserName": "[variables('adminUserName')]",
"Password": "PrivateSettingsRef:adminPassword"
}
}
},
"protectedSettings": {
"Items": {
"adminPassword": "[variables('adminPassword')]"
}
}
}
}
]
}