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": "[uri(parameters('_artifactslocation'), concat('shared/newnsg.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"nsgname": {"value": "[variables('nsgname')]"}, "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": "[uri(parameters('_artifactslocation'), concat('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('nsgname')]"}}}}{"apiversion": "2017-05-10", "name": "[variables('nesteddeploymentnamenic')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('shared/nic-config.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"vnetname": {"value": "[variables('vnetname')]"}, "subnetname": {"value": "[variables('subnetname')]"}, "publicipname": {"value": "[variables('publicipname')]"}, "subnetid": {"value": "[parameters('subnetid')]"}}}}{"apiversion": "2017-05-10", "name": "[variables('nesteddeploymentnameprof')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('shared/os-disk-parts-md.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"imagesku": {"value": ""}, "imagepublisher": {"value": ""}, "imageoffer": {"value": ""}, "imageversion": {"value": ""}, "osdisktype": {"value": "[variables('osdisktype')]"}, "ostype": {"value": "[variables('internalostype')]"}, "vmname": {"value": "[variables('vmname')]"}, "storagetype": {"value": "premium_lrs"}, "manageddiskid": {"value": "[parameters('userdiskid')]"}}}}{"apiversion": "2017-05-10", "name": "[variables('nesteddeploymentnamepip')]", "type": "microsoft.resources/deployments", "condition": "[equals(length(parameters('subnetid')), 0)]", "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('shared/newpip.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"publicipname": {"value": "[variables('publicipname')]"}, "publicipaddresstype": {"value": "dynamic"}}}}{"apiversion": "2017-05-10", "name": "[variables('nesteddeploymentname')]", "type": "microsoft.resources/deployments", "dependson": ["[concat('microsoft.resources/deployments/", variables('nesteddeploymentnameprof'))]", "[concat('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('shared/server-md.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"imagereference": {"value": "[reference(variables('nesteddeploymentnameprof')).outputs.osdisk.value]"}, "osdisk": {"value": "[reference(variables('nesteddeploymentnameprof')).outputs.osdisk.value]"}, "osdisktype": {"value": "[variables('osdisktype')]"}, "vmname": {"value": "[variables('vmname')]"}, "vmsize": {"value": "[variables('vmsizes')[parameters('sapsystemsize')].size]"}, "adminusername": {"value": ""}, "adminpassword": {"value": ""}, "csextensionscript": {"value": "[variables('csextension')[variables('internalostype')].script]"}, "csextensionscriptcall": {"value": "[variables('csextension')[variables('internalostype')].scriptcall]"}, "csextensionscriptargs": {"value": ""}, "avsetobj": {"value": {"id": ""}}, "useavset": {"value": false}, "nicname": {"value": "[variables('nicname')]"}, "datadisksobj": {"value": {"copy": [{"name": "datadisks", "count": "[length(variables('datadisksizes'))]", "input": {"lun": "[copyindex('datadisks')]", "createoption": "empty", "disksizegb": "[variables('datadisksizes')[copyindex('datadisks')].size]"}}]}}, "ostype": {"value": "[variables('internalostype')]"}}}} 