I have an Azure pipeline that creates a new DevTest Lab VM from an Azure Resource Manager (ARM) template. That works great but a new resource group is created for the VM. I would like to specify an existing resource group the VM should belong to but I can't figure out how to configure this in the Azure DevTest Labs Create VM
task or in the ARM template JSON file.
I found one example that provided a resourceGroup
parameter as part of the resources
object in the JSON but that that gives me an invalid template error:
...
"resources": [
{
...
"type": "Microsoft.DevTestLab/labs/virtualmachines",
"name": "[variables('vmName')]",
"resourceGroup": "[parameters('cdResourceGroup')]",
...
}
]
...
This seems like something that should be fairly straightforward but I haven't been able to find this documented.