Public/IaaS/vm/New-CmAzIaasVm.ResourceGroups.json

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "ResourceGroups": {
            "type": "Array"
        }
    },
    "resources": [
    {
        "type": "Microsoft.Resources/resourceGroups",
        "apiVersion": "2018-05-01",
        "name": "[parameters('ResourceGroups')[copyIndex('ResourceGroupsCopy')].name]",
        "tags": {
            "cm-service": "[parameters('ResourceGroups')[copyIndex('ResourceGroupsCopy')].service.publish.resourceGroup]"
        },
        "location": "[parameters('ResourceGroups')[copyIndex('ResourceGroupsCopy')].location]",
        "copy": {
            "name": "ResourceGroupsCopy",
            "count": "[Length(parameters('ResourceGroups'))]"
        }
    }
] }