Enable AzureResourceManager module in Azure Automation
This may be a bug but when trying to run any AzureResourceManager type command such as: Get-AzureResource or Set-AzureResource the following error is received:
The term 'Get-AzureResource' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
This is really important for being able to do things like change the hosting plan from free to standard (would be great if that was more easy/direct too)
Nidhi Sharma commented
I want to take snapshot of existing disk, but unable to do so through automation runbook. Getting below error.
The term 'New-AzureRmSnapshotConfig' and 'New-AzureRmSnapshot' are not recognized as the name of a cmdlet, function, script file.
Kindly provide suggestions.
William Lee commented
I got the following.... can we add them?
The term 'Get-AzureRmNetworkInterface' is not recognized as the name of a cmdlet
The term 'Get-AzureRmNetworkSecurityGroup' is not recognized as the name of a cmdlet
The term 'Add-AzureRmNetworkSecurityRuleConfig' is not recognized as the name of a cmdlet
Trevor Sullivan [MVP] commented
In my opinion, the full suite should be provided out of the box, without users having to request a specific module.
Microsoft MVP: PowerShell
Benedikt Althaus commented
Please add AzureRM.Network as a global module.
Update: AzureRM.Storage, Azure.Storage, AzureRM.Automation, AzureRM.Resources, and AzureRM.Sql are now available as global modules in Automation.
The Automation team is working towards adding the following ARM modules:
AzureRM.Storage, Azure.Storage, AzureRM.Automation, AzureRM.Resources, AzureRM.Sql. We expect these to come out in the near future.
As mentioned in the comments below, you can use www.powershellgallery.com to deploy to Automation or use this blog http://blog.coretech.dk/jgs/azure-automation-script-for-downloading-and-preparing-azurerm-modules-for-azure-automation/ to get any missing modules in for now.
Jay Avent commented
I was able to add AzureRM.Resources using this guide (and updating the build number) - http://blog.coretech.dk/jgs/azure-automation-script-for-downloading-and-preparing-azurerm-modules-for-azure-automation/
Also heard it may be added as a global module within the next three weeks, so fingers crossed!
Risto Lavett commented
Tip, I managed to import AzureRM.Resources other should work also from using the templates "deploy to azure automation" found here https://goo.gl/gJmYvq
Risto Lavett commented
Any update when the AzureRM.Resources will be available?
Jay Avent commented
Definitely AzureRM.Resources, along with AzureRM.Storage & AzureRM.Network please!
Stephane Lapointe commented
We really need AzureRM.Resources available next. This will unblock all automation scenarios while other AzureRM.* global automation modules becomes available.
We'll be able to perform calls to Get-AzureRmResource, Find-AzureRmResource, etc.. Which are not like using the native module cmdlets but will enable us to perform any operations on a Resource Provider.
Casey Hulbert commented
Automatic updating and additional of AzureRM modules.
AzureRM.Resources is next on our list.
Good to see this start to get rolled out, looking forward to full coverage. My vote for immediate need is the AzureRM.Resources module.
I'm also using the Set-AzureResource activity following the workaround blog below, but it requires user interaction which cannot be achieved in runbooks.
Do you have any other suggestions as I've also tried the -Force argument with no luck.
do you have estimated dates when you see ARM to be released?
While we are waiting for ARM to be officially supported, you can take a look at this blog https://azure.microsoft.com/blog/2015/07/14/using-azure-resource-manager-in-azure-automation-runbooks/ as a workaround.
Hi folks, when you add ARM support please consider the coexistence between ARM and the old Service model. During the migration from the service model to ARM we need to have runbooks that address both APIs. For example I have a runbook that needs to start and stop VMs based on a specific tag. Some VMs are of type Microsoft.Compute other of type Microsoft.ClassicCompute. Since many cmdlet have exactly the same name (for example get-azurevm) and calling them with the module prefix (ex Azure\Get-AzureVM) doesn't seem to work properly, it's super important that when you add ARM support we can use both interfaces in the same runbook.
Pete Zerger commented
Beth, we need AzureResourceManager to ship in Azure Automation by default because it is only with the cmdlets in this module that we can interact with resources deployed using Azure Resource Manager templates (IaaS v2). That being said, the fact that the ARM PowerShell module contains cmdlets (like Get-AzureVM) with the same name but different parameters is a big problem. The cmdlets in the ARM module should be renamed to avoid confusion...and the need to specify the full path (module\cmdlet) every time we are calling a conflicting cmdlet.
Joe Levy (Azure Automation Team) commented
For now take a look at my answer on the forum about this, should help you get ARM working in Azure Automation: https://social.msdn.microsoft.com/Forums/en-US/c65ebb66-f83e-4d25-8b9c-5e1a66a7850b/resource-manager-cmdlets?forum=azureautomation&prof=required