Looking to use both this runbook and the Turn Off one as well to ensure VM's are powered on first before being Updated, using Azure Server Update Management (ASUM).
We can set the pre-script for our update deployment schedule to this Runbook, Update-management-turn-on-vms but when the update deployment runs, this runbook fails with multiple errors.
-
Get-AzureRmResource : Parameter set cannot be resolved using the specified named parameters. At line:111 char:23 + ... nResource = Get-AzureRmResource -ResourceType Microsoft.Automation/Au ...
-
New-AzureRmAutomationVariable : Cannot validate argument on parameter 'ResourceGroupName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At line:125 char:50
-
Set-AzureRmContext : Parameter cannot be processed because the parameter name 'Subscription' is ambiguous. Possible matches include: -SubscriptionId -SubscriptionName. At line:142 char:40
-
Get-AzureRmVM : A parameter cannot be found that matches parameter name 'DefaultProfile'. At line:144 char:68 + ... RmVM -ResourceGroupName $rg -Name $name -Status -DefaultProfile $mute
-
Cannot index into a null array. At line:147 char:5 + $state = ($vm.Statuses[1].DisplayStatus -split " ")
-
Set-AzureRmContext : Parameter cannot be processed because the parameter name 'Subscription' is ambiguous. Possible matches include: -SubscriptionId -SubscriptionName. At line:142 char:40
-
Get-AzureRmVM : A parameter cannot be found that matches parameter name 'DefaultProfile'. At line:144 char:68 + ... RmVM -ResourceGroupName $rg -Name $name -Status -DefaultProfile $mute
-
Cannot index into a null array. At line:147 char:5 + $state = ($vm.Statuses[1].DisplayStatus -split " ")
-
Set-AutomationVariable : Variable not found. To create this Variable, navigate to the Variables blade and create a Variable named:
To my very untrained eye, it looks like the runbook is not able to parse the passed variable from the Update Management API,
param(
[string]$SoftwareUpdateConfigurationRunContext
)
From what I understand, this is passed from Update Management directly when a deployment is ran.
Output from the runbook does display the name of the VM's selected to be update, but no action to start the VM's is attempted,
Environments Context
{[AzureCloud, AzureCloud], [AzureChinaCloud, AzureChinaCloud], [AzureUSGovernment, AzureUSGovernment]} Microsoft.Azur...
Subscription Id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NxAVD-4: no action taken. State:
Subscription Id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NxAVD-5: no action taken. State: