name Azure Powershell CMD list
type link
action https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ps-common-ref

Create a VM

Create a VM with public IP and then connect to it byRemote_Desktop_Protocol, Costs around 130-180 dollars a month.

  • VM comes under compute service.

VM Availability

First option gets your machine copied to other machines, creates three copies.

  • From images selected windows or linux VM image.

VM sizes

Azure_Spot_Instance Request for free if nobody else is using. b2ms is decent machine to start. RDP port 3389

Azure VM Disks and Networking Options

VM advanced options

  • Dedicated hosts Seprate your VM from other machines.
  • tags are like environment variables.

Connecting to an Azure VM- RDP and SSH

  • Azure VM is created by combining several azure modules.
  • DownloadRemote_Desktop_Protocol file.
  • Putting IP address should fetch the IIS homepage, as our server port 80 is open.

Modify and Stop a VM

  • Scaling is easy, just change the size.
  • By Azure Devops, you can create a pipeline that installs softwares.
  • Charged by time it runs, if not using, you can stop, may be charged for storage if the option to delete storage was checked.
  • In cleanup, delete the resource group as well for better cleanup.

Azure Resource Manager model (ARM)

Azure_Resource_Manager_Model

  • BICEP is a recent tool to create ARM templates.
  • Download a template for automation.
  • This is theInfrastructure_As_A_Code
  • Create hundreds of Virtual machines from theARM_template
  • ARM_template can be installed by using powershell or azure CLI.

New-AzResourceGroupDeployment

Create a VM using Powershell

  • Access using cloudshell as it is always updated.
  • There is option to select bash or powershell.
  • Create new resource group.

New-AzResourceGroup -Name oneGroup -Location ‘EastUS’

  • Create new VM, options can be ports to outbound, public IP config name, machine size.

New-AzVM -ResourceGroupName oneGroup …

Same steps can be followed to do it from your local machine

  1. Connect-AzAccount

  2. Virtual machine have to be part of a virtual network.
  3. Azure CLI commands.

az group create —name cligroup —location eastus az vm create —resource-group cligroup —name aznewvm2 —image win2016datacenter