What's the difference between Get-AzureRmVM and Get-AzureVM
I'm trying to set up a Load Balancer on Azure. I'm following this doc. At the end, you basically have to attach your virtual network adapter to a running VM. The docs refer to using Get-AzureRmVM
to find the desired VM name in the desired resource group. However, though I can see various VMs running on the web portal, when I type:
Get-AzureRmVM
I don't get any results. However, if I type:
Get-AzureVM
I see all my virtual machines. The parameters are slightly different, but it seems similar.
My Question:
What is the difference between Get-AzureRmVM
and Get-AzureVM
? Why do all the docs say to use Get-AzureRmVM
when it doesn't appear to work?
If you are using classic (v1) VMs, then you aren't using resource manager, and thus the RM-specific cmdlets will return nothing, as you are seeing.
To complete previous answer.
If you are using classic portal (https://manage.windowsazure.com), you can create only V1 VM (also named Classic VM or ASM VM).
With the new Azure Portal (https://portal.azure.com), when you create a VM, you can choose the old model (Classic) or the new one called Azure Resource Manager (RM is for Resource Manager).
Because of confusion in Powershell during the last month (there was 2 mode in Powershell : ASM and ARM with a switch command) due to same commands with different arguments, Powershell Team decided to remove switch-mode command and change PowerShell syntax (all the storie is here : https://github.com/Azure/azure-powershell/wiki/Deprecation-of-Switch-AzureMode-in-Azure-PowerShell)
So if there is "Azurerm" is a command, that means this commmand applies only on v2 (ARM) VM and not classic.
hope this help
Stanislas