Reputation: 2066
It might be a newbie question, as that's what I am, but I wish it doesn't bother anyone out there as I haven't been able to find a proper explanation.
I am trying to get my head around azure and I have been looking into managing my subscription using powershell. Thing is that I have found two modules that kind of do the same (to my eyes) Azure and AzureRM.
Does anyone know the difference?
Thanks,
Upvotes: 1
Views: 337
Reputation: 10985
The Azure PowerShell Cmdlets have been going through a lot of change lately, so yes, it can be a little confusing. To be fair, they really do much of the same thing.
As you've seen if you install the Azure PowerShell 1.0.1 from either the Web Platform Installer or the PowerShell Gallery you' find that they are divided into modules for "Service Management" and "Azure Resource Manager". If you do a "Get-module -ListAvailable" you'll see the breakdown. Note that there is the module Azure under the ServiceManagement folder and then there are many modules under the AzureResourceManager folder, and these are suffixed with "RM" for resource manager.
What @theadriangreen pointed out in his answer is correct, Azure Resource Manager has a LOT of power when trying to deploy a bunch of related resources all at one time. Using Azure Resource Manager (ARM) templates you can deploy an entire environment in one go, or even destroy it. Really, really powerful. However, where he is incorrect is that ARM cmdlets can also be used to work with resources in azure on specific services. The Get-AzureRMVM cmdlet will retrieve a list of VMs or a specific one) just like Get-AzureVM from the Azure Service Management module will do. ARM isn't ONLY about doing things in large grain operations.
The real difference between these two as I understand it is that the Azure module (Service Management) uses an older "Service Management Plane" (a Microsoft term). It's the older API used to manage your Azure resources. ARM uses a newer management API and is the new way to manage your Azure resources. The disconnect currently, and why you need both, is that not ALL Azure resources are currently available in ARM and not all newer services are available on the older service management plane. This is why you also see two Azure portals with some services only being available in one of them. As each team makes progress on converting they are writing "Resource Providers" which are used to map their service to the ARM system. This isn't trivial, and they are trying to do it while they make improvements on their service at the same time.
Note that the AzureRM* cmdlets only pull back the resources that were created with ARM, and not the older "classic" resources. Vice versa with the Azure service management cmdlets will only show you things created with it (or via the older portal or on the new portal in "classic" mode). This is a sad fact now while things are still transitioning over to ARM.
Also, now with 1.0 of the cmdlets you the Switch-AzureMode cmdlet has been deprecated and you no longer need to use it. They made it possible to use both the older Azure service management cmdlets and the newer ARM cmdlets at the same time. They also spent a lot of time breaking down the ARM cmdlets into more isolated modules so that they can be deployed independently and you only have to grab what you need to use module wise.
My suggestion is to use the ARM modules only going forward if you can unless a service you work with only exists in the older Azure service management cmdlets, or if you have resources out in Azure that were created on the old management plane and therefore do not show up in any of the ARM cmdlets. Sooner or later the older management plane will be less and less useful and I'd venture a guess they will eventually retire it (though that's my speculation and nothing I've heard directly from Microsoft and I would expect that support for the older management plane will exist for a long time to come).
Upvotes: 3
Reputation: 2223
I think there's some misunderstanding here. Let us consider the Azure powershell as outlined in this post: https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/
There are two modes of operation, AKA "Azure modules": AzureResourceManager and AzureServiceManagement. You can switch between them with the cmdlet Switch-AzureMode
(https://msdn.microsoft.com/en-us/library/dn722470.aspx).
AzureResourceManager provides a more general method of operation, and allows you to deal with all Azure resources at once (see https://msdn.microsoft.com/en-us/library/azure/mt125356.aspx). Consider for example the New-AzureResourceGroup
cmdlet (https://msdn.microsoft.com/en-us/library/dn654594.aspx). It allows you to set up a deployment using templates that may include a web site, a VM, and a database, all in the same command. This power comes from the Azure Resource Model.
Now the AzureServiceManagement mode restricts the commands to specific Azure service providers (see https://msdn.microsoft.com/en-us/library/azure/dn708504.aspx). i.e. the Get-AzureVM specifically deals with the VM service, and the Get-AzureWebsite cmdlet specifically deals with the Website service.
Upvotes: 1
Reputation: 4320
My understanding is that the Azure module interacts with your Azure subscriptions, primarily over a REST API. You can use this to work with Azure's PAAS features.
The Azure Resource Manager modules are for working specifically with VMs in Azure, for example: allowing you to set up Desired State Configuration. This is generally what you'd use if you use Azure from an IAAS point of view.
Upvotes: 0