This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"apiversion": "2017-05-10", "name": "[variables('nesteddeploymentnamensg')]", "type": "microsoft.resources/deployments", "condition": "[equals(length(parameters('subnetid')), 0)]", "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(parameters('_artifactslocation'), "/shared/newnsg.json", parameters('_artifactslocationsastoken'))]", "contentversion": "1.0.0.0"}, "parameters": {"nsgname": {"value": "[variables('nsgnamecl')]"}, "ostype": {"value": "[variables('internalostype')]"}}}}{"apiversion": "2017-05-10", "name": "[variables('nesteddeploymentnamevnet')]", "type": "microsoft.resources/deployments", "condition": "[equals(length(parameters('subnetid')), 0)]", "dependson": ["[concat('microsoft.resources/deployments/", variables('nesteddeploymentnamensg'))]"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(parameters('_artifactslocation'), "/shared/newvnetnsg.json", parameters('_artifactslocationsastoken'))]", "contentversion": "1.0.0.0"}, "parameters": {"vnetname": {"value": "[variables('vnetname')]"}, "addressprefix": {"value": "10.0.0.0/16"}, "subnetname": {"value": "[variables('subnetname')]"}, "subnetprefix": {"value": "10.0.0.0/24"}, "nsgname": {"value": "[variables('nsgnamecl')]"}}}} 