This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"apiversion": "2020-06-01", "name": "deploy", "type": "microsoft.resources/deployments", "resourcegroup": "[parameters('virtualnetworkresourcegroupname')]", "dependson": ["new-nsg"], "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('nested/updatesubnet.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"virtualnetworkname": {"value": "[parameters('virtualnetworkname')]"}, "subnetname": {"value": "[parameters('subnetname')]"}, "subnetaddressprefix": {"value": "[reference(resourceid(parameters('virtualnetworkresourcegroupname'), "microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname')), "2020-08-01').addressprefix]"}, "nsgid": {"value": "[resourceid('microsoft.network/networksecuritygroups", "new-nsg')]"}, "location": {"value": "[parameters('location')]"}}}} 