This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"condition": "[parameters('useexistingvnetandsubnet')]", "type": "microsoft.resources/deployments", "apiversion": "2019-10-01", "name": "[format('{0}-subnet-delegation-{1}", parameters('subnetname'), variables('unistr'))]", "resourcegroup": "[parameters('vnetresourcegroupname')]", "properties": {"expressionevaluationoptions": {"scope": "inner"}, "mode": "incremental", "parameters": {"virtualnetworkname": {"value": "[parameters('virtualnetworkname')]"}, "subnetname": {"value": "[parameters('subnetname')]"}, "subnetaddressprefix": {"value": "[parameters('subnetaddressprefix')]"}}, "template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymenttemplate.json#", "contentversion": "1.0.0.0", "parameters": {"virtualnetworkname": {"type": "string", "metadata": {"description": "required. the virtual network (vnet) name."}}, "subnetname": {"type": "string", "metadata": {"description": "required. the subnet name of asev3."}}, "subnetaddressprefix": {"type": "string", "metadata": {"description": "required. the subnet name of asev3."}}}, "functions": [], "resources": [{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-11-01", "name": "[format('{0}/{1}", parameters('virtualnetworkname'), parameters('subnetname'))]", "properties": {"addressprefix": "[parameters('subnetaddressprefix')]", "delegations": [{"name": "microsoft.web.hostingenvironments", "properties": {"servicename": "microsoft.web/hostingenvironments"}}]}}]}}}{"condition": "[and(parameters('createprivatedns'), equals(parameters('internalloadbalancingmode'), 3))]", "type": "microsoft.resources/deployments", "apiversion": "2019-10-01", "name": "[format('private-dns-zone-deployment-{0}", variables('unistr'))]", "properties": {"expressionevaluationoptions": {"scope": "inner"}, "mode": "incremental", "parameters": {"privatednszonename": {"value": "[reference(resourceid('microsoft.web/hostingenvironments", parameters('asename'))).dnssuffix]"}, "virtualnetworkid": {"value": "[variables('virtualnetworkid')]"}, "asename": {"value": "[parameters('asename')]"}}, "template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymenttemplate.json#", "contentversion": "1.0.0.0", "parameters": {"asename": {"type": "string", "metadata": {"description": "required. ase name."}}, "privatednszonename": {"type": "string", "metadata": {"description": "required. private dns zone name."}}, "virtualnetworkid": {"type": "string", "metadata": {"description": "required. network id."}}}, "functions": [], "resources": [{"type": "microsoft.network/privatednszones", "apiversion": "2020-06-01", "name": "[parameters('privatednszonename')]", "location": "global", "properties": {}}, {"type": "microsoft.network/privatednszones/virtualnetworklinks", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('privatednszonename'), "vnetlink')]", "location": "global", "properties": {"virtualnetwork": {"id": "[parameters('virtualnetworkid')]"}, "registrationenabled": false}, "dependson": ["[resourceid('microsoft.network/privatednszones", parameters('privatednszonename'))]"]}, {"type": "microsoft.network/privatednszones/a", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('privatednszonename'), "*')]", "properties": {"ttl": 3600, "arecords": [{"ipv4address": "[reference(resourceid('microsoft.web/hostingenvironments/configurations", split(format('{0}/networking", parameters('asename')), "/')[0], split(format('{0}/networking", parameters('asename')), "/')[1]), "2021-01-15').internalinboundipaddresses[0]]"}]}, "dependson": ["[resourceid('microsoft.network/privatednszones", parameters('privatednszonename'))]"]}, {"type": "microsoft.network/privatednszones/a", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('privatednszonename'), "*.scm')]", "properties": {"ttl": 3600, "arecords": [{"ipv4address": "[reference(resourceid('microsoft.web/hostingenvironments/configurations", split(format('{0}/networking", parameters('asename')), "/')[0], split(format('{0}/networking", parameters('asename')), "/')[1]), "2021-01-15').internalinboundipaddresses[0]]"}]}, "dependson": ["[resourceid('microsoft.network/privatednszones", parameters('privatednszonename'))]"]}, {"type": "microsoft.network/privatednszones/a", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('privatednszonename'), "@')]", "properties": {"ttl": 3600, "arecords": [{"ipv4address": "[reference(resourceid('microsoft.web/hostingenvironments/configurations", split(format('{0}/networking", parameters('asename')), "/')[0], split(format('{0}/networking", parameters('asename')), "/')[1]), "2021-01-15').internalinboundipaddresses[0]]"}]}, "dependson": ["[resourceid('microsoft.network/privatednszones", parameters('privatednszonename'))]"]}]}}, "dependson": ["[resourceid('microsoft.web/hostingenvironments", parameters('asename'))]"]} 