{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "webAppName": { "defaultValue": "nattest", "type": "string" }, "location": { "defaultValue": "[resourceGroup().location]", "type": "string" } }, "variables": { "appServicePlanName": "[concat(parameters('webAppName'), '-asp')]", "vNetName": "[concat(parameters('webAppName'), '-vnet')]", "pipName": "[concat(parameters('webAppName'), '-pip')]", "natName": "[concat(parameters('webAppName'), '-nat')]", "appServicePlanSize": "P1v2", "appServicePlanInstanceCount": 1, "location": "[parameters('location')]", "webAppName": "[parameters('webAppName')]" }, "functions": [ ], "resources": [ { "type": "Microsoft.Network/publicIPAddresses", "apiVersion": "2020-05-01", "name": "[variables('pipName')]", "location": "[variables('location')]", "sku": { "name": "Standard" }, "properties": { "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Static" } }, { "name": "[variables('appServicePlanName')]", "type": "Microsoft.Web/serverfarms", "apiVersion": "2018-02-01", "location": "[variables('location')]", "tags": { }, "properties": { "reserved": false }, "sku": { "name": "[variables('appServicePlanSize')]", "capacity": "[variables('appServicePlanInstanceCount')]" } }, { "name": "[variables('webAppName')]", "type": "Microsoft.Web/sites", "apiVersion": "2018-11-01", "location": "[variables('location')]", "tags": { }, "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", "[resourceId('Microsoft.Network/virtualNetworks', variables('vNetName'))]" ], "properties": { "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", "siteConfig": { "http20Enabled": true, "minTlsVersion": "1.2", "vnetRouteAllEnabled": true }, "httpsOnly": false }, "resources": [ { "name": "virtualNetwork", "type": "networkConfig", "apiVersion": "2018-11-01", "location": "[variables('location')]", "properties": { "subnetResourceid": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vnetName'), 'outbound')]", "swiftSupported": true }, "dependsOn": [ "[resourceId('Microsoft.Web/sites', variables('webAppName'))]" ] } ] }, { "name": "[variables('vNetName')]", "type": "Microsoft.Network/virtualNetworks", "apiVersion": "2019-11-01", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Network/natGateways', variables('natName'))]" ], "properties": { "addressSpace": { "addressPrefixes": [ "10.0.0.0/16" ] }, "subnets": [ { "name": "inbound", "properties": { "addressPrefix": "10.0.0.0/24", "serviceEndpoints": [ { "service": "Microsoft.Web", "locations": [ "*" ] } ] } }, { "name": "outbound", "properties": { "addressPrefix": "10.0.1.0/24", "delegations": [ { "name": "serverFarmDelegation", "properties": { "serviceName": "Microsoft.Web/serverFarms" } } ], "natGateway": { "id": "[resourceId('Microsoft.Network/natGateways', variables('natName'))]" } } } ] } }, { "type": "Microsoft.Network/natGateways", "apiVersion": "2020-05-01", "name": "[variables('natName')]", "location": "[variables('location')]", "dependsOn": [ "[resourceId('Microsoft.Network/publicIPAddresses', variables('pipName'))]" ], "sku": { "name": "Standard" }, "properties": { "idleTimeoutInMinutes": 4, "publicIpAddresses": [ { "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('pipName'))]" } ] } } ], "outputs": { } }