Home > database >  Azure VM templates
Azure VM templates

Time:08-20

So, I exported a VM template and I'm trying to build more VMs based on that template.

How can I define the subscription, resource group and region in the template or in the parameters file?

CodePudding user response:

You can use Azure Powershell to Deploy Virtual Machine, I have reproduced in my environment and followed Microsoft-Document :

Firstly if you donot have a resourcegroup create it using below cmdllet:

New-AzResourceGroup -Name 'rithwik' -Location 'EastUS'

(rithwik- Resourcegroup name)

enter image description here

Then you need to try below cmdlet for deploying VM:

New-AzVm `
    -ResourceGroupName 'myResourceGroup' `
    -Name 'myVM' `
    -Location 'East US' `
    -VirtualNetworkName 'myVnet' `
    -SubnetName 'mySubnet' `
    -SecurityGroupName 'myNetworkSecurityGroup' `
    -PublicIpAddressName 'myPublicIpAddress' `
    -OpenPorts 80,3389

After giving the command type your username and password as below:

enter image description here

Output:

enter image description here

References of Code taken from:

In Portal:

enter image description here

  • Related