workflow Start-SampleVM
{
Param
(
[parameter(Mandatory=$true)]
[String]
$VMName,
[parameter(Mandatory=$true)]
[String]
$ServiceName
)
$subscriptionName = Get-AutomationVariable -Name "SubscriptionName"
$subscriptionID = Get-AutomationVariable -Name "SubscriptionID"
$certificateName = Get-AutomationVariable -Name "CertificateName"
$certificate = Get-AutomationCertificate -Name $certificateName
Set-AzureSubscription -SubscriptionName $subscriptionName -SubscriptionId $subscriptionID -Certificate $certificate
Select-AzureSubscription $subscriptionName
Start-AzureVM -Name $VMName -ServiceName $ServiceName
}
Obviously, I've created the certificate and uploaded the certificate in Settings, and added in the automation Assets. I get the same error running "StopMyAzureVMs" downloaded from Script Center. Also added screenshot of the Assets.
Any ideas?
Thanks.