azureazure-virtual-machineazure-virtual-networkazure-rm-templateazure-vm-templates

How can I add Azure VM to existing Vnet or new Vnet using ARM template


I am creating JSON file for ARM template to deploy Azure VM and its dependent resources.

I have created RHEL VM with following resources(all are newly created):-

Storage Account
Diagnostic Storage Account
Virtual Network
Network Interface
Public IP Address
Network Security Group

Now I want to create Azure VM with existing Vnet, Subnet or new Vnet, subnet. Is there any example I can follow up. How can I do so?


Solution

  • Now I want to create Azure VM with existing Vnet

    You could refer to this example.

    If you want to more templates, you could search the templates gallery to discover what you need.

    or new Vnet, subnet.

    You could refer to this example, just use an existing resource group.