{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-quickstart-templates/issues/2786","repository_url":"https://api.github.com/repos/Azure/azure-quickstart-templates","labels_url":"https://api.github.com/repos/Azure/azure-quickstart-templates/issues/2786/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-quickstart-templates/issues/2786/comments","events_url":"https://api.github.com/repos/Azure/azure-quickstart-templates/issues/2786/events","html_url":"https://github.com/Azure/azure-quickstart-templates/issues/2786","id":190835589,"number":2786,"title":"Create VNET without destroying all subnets","user":{"login":"gregjhogan","id":4112046,"avatar_url":"https://avatars.githubusercontent.com/u/4112046?v=3","gravatar_id":"","url":"https://api.github.com/users/gregjhogan","html_url":"https://github.com/gregjhogan","followers_url":"https://api.github.com/users/gregjhogan/followers","following_url":"https://api.github.com/users/gregjhogan/following{/other_user}","gists_url":"https://api.github.com/users/gregjhogan/gists{/gist_id}","starred_url":"https://api.github.com/users/gregjhogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregjhogan/subscriptions","organizations_url":"https://api.github.com/users/gregjhogan/orgs","repos_url":"https://api.github.com/users/gregjhogan/repos","events_url":"https://api.github.com/users/gregjhogan/events{/privacy}","received_events_url":"https://api.github.com/users/gregjhogan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-21T21:05:49Z","updated_at":"2016-12-11T09:33:27Z","closed_at":null,"body":"I want to create subnets dynamically (separately from my VNET).  I see there is a way to create a subnet inside an existing VNET, indicating that a subnet is a child resource of a VNET.\r\n\r\nhttps://github.com/Azure/azure-quickstart-templates/blob/master/101-subnet-add-vnet-existing/azuredeploy.json\r\n\r\nHowever, I can't find a way to re-deploy the VNET template without blowing away all subnets, because if I leave off the subnets property it deletes all the VNETs.  Is there a way to deploy a VNET without including (and destroying) the subnets?\r\n\r\nHere is an example template deploying a VNET (which destroys all subnets)\r\n```javascript\r\n{\r\n    \"$schema\": \"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\",\r\n    \"contentVersion\": \"1.0.0.0\",\r\n    \"parameters\": {\r\n        \"vnetAddressPrefixes\": {\r\n            \"type\": \"array\"\r\n        }\r\n    },\r\n    \"variables\": {\r\n        \"apiVersion\": \"2015-06-15\",\r\n        \"namePrefix\": \"[concat(replace(subscription().displayName, ' ', '_'), '_')]\",\r\n        \"vnetName\": \"[concat(variables('namePrefix'), 'VNET')]\"\r\n    },\r\n    \"resources\": [\r\n        {\r\n            \"apiVersion\": \"[variables('apiVersion')]\",\r\n            \"type\": \"Microsoft.Network/virtualNetworks\",\r\n            \"name\": \"[variables('vnetName')]\",\r\n            \"location\": \"[resourceGroup().location]\",\r\n            \"dependsOn\": [],\r\n            \"properties\": {\r\n                \"addressSpace\": {\r\n                    \"addressPrefixes\": \"[parameters('vnetAddressPrefixes')]\"\r\n                }\r\n            }\r\n        }\r\n    ]\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/Azure/azure-quickstart-templates/issues/comments/266272126","html_url":"https://github.com/Azure/azure-quickstart-templates/issues/2786#issuecomment-266272126","issue_url":"https://api.github.com/repos/Azure/azure-quickstart-templates/issues/2786","id":266272126,"user":{"login":"MCKLMT","id":5141735,"avatar_url":"https://avatars.githubusercontent.com/u/5141735?v=3","gravatar_id":"","url":"https://api.github.com/users/MCKLMT","html_url":"https://github.com/MCKLMT","followers_url":"https://api.github.com/users/MCKLMT/followers","following_url":"https://api.github.com/users/MCKLMT/following{/other_user}","gists_url":"https://api.github.com/users/MCKLMT/gists{/gist_id}","starred_url":"https://api.github.com/users/MCKLMT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MCKLMT/subscriptions","organizations_url":"https://api.github.com/users/MCKLMT/orgs","repos_url":"https://api.github.com/users/MCKLMT/repos","events_url":"https://api.github.com/users/MCKLMT/events{/privacy}","received_events_url":"https://api.github.com/users/MCKLMT/received_events","type":"User","site_admin":false},"created_at":"2016-12-11T09:33:27Z","updated_at":"2016-12-11T09:33:27Z","body":"I guess you should use the incremental mode: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-deploy#incremental-and-complete-deployments\r\nBut in the case of the VNet, I think you should always define the Subnets in the template with the VNet."}}
{"actor":{"display_login":"MCKLMT"}}