I am using a json file to create a VM. Everything works good with exception of the vnet and subnet, every time I created a new VM, it creates a new vnet and subnet, how can I create VMs and assign them to an existing vnet and subnet using a json template?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Have you tried below sample template
https://github.com/Azure/azure-quickstart-templates/tree/master/201-vm-different-rg-vnet
you should be able to update your ARM template to create your VM into an existing VNet.
回答2:
am assuming by json, you mean an ARM Template.
you should be able to do that by grabbing a subnet reference to the existing subnet on your existing VNET and then associating your new VM's NIC to the subnet reference you obtained. have a look at sample here