0
votes

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?

2

2 Answers

3
votes

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.

1
votes

This is pretty straightforward with Microsoft's documentation.

The challenge here usually lies with understanding the dependencies. In that example, you aren't saying I want this VM to launch in this Vnet, you are saying, "I want this VM to use this NIC which is associated with this Subnet of this Vnet"

It is easiest to just use the example provided at the bottom of that link and work your way forward. With your case, you will end up being able to simply remove the Vnet resource block and add your own Vnet's properties in.

This is an extra tool for working with ARM templates.