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
- Create a New Azure VM
- Select cmd let from Refer Here
- The other option is to search for VM cmdlets
- Now get help Refer Here
- Create a resource Group 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
- 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'
- 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
- 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
