Azure Classroom Series – 21/Oct/2021

Azure Powershell and Virutal Machines

  • Powershell commands are called as cmd-lets, They will be in the form of verb-noun
  • When we install azure powershell in the system the azure cmdlets will be created in the system verb-Aznoun
  • For Azure Powershell cmd lets naviage to the reference section Refer Here
  • Lets create a Windows VM
    • Create a resource Group Refer Here Preview
    • Create a New Azure VM
      • Select cmd let from Refer Here
      • The other option is to search for VM cmdlets Preview
      • Now get help Refer Here
  • For creating powershell scripts ensure Powershell extension is installed in Visual Studio Code and we create .ps1 files to use the support from visual studio code Preview
  • The Script developed
$resg = New-AzResourceGroup -Name 'psdemo' -Location 'eastus'

$vm = New-AzVM `
        -ResourceGroupName $resg.ResourceGroupName `
        -Name 'mywinvm' `
        -Location $resg.Location -VirtualNetworkName "myvnet" `
        -SubnetName "mysubnet" -SecurityGroupName "mynsg" `
        -PublicIpAddressName 'mypip' -OpenPorts 80,3389 `
        -Size 'Standard_B1s'

Preview Preview

  • Connect to Windows VM using mstsc and Launch the powershell in the Remote windows server and Execute the following command to install iis server
Install-WindowsFeature -name Web-Server -IncludeManagementTools

Preview

  • Exercise: Try using the above version of command with -Linux (new resource group and other parameter values). The default version of the -Image has Win2016Datacenter. Try create any flavor of linux with this. and also Refer Here

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube