Quantcast
Channel: Azure Virtual Machines forum
Viewing all articles
Browse latest Browse all 12545

Error: Get-AzureVM : Value cannot be null. Parameter name: managementCertificate

$
0
0
I get "Error: Get-AzureVM : Value cannot be null. Parameter name: managementCertificate" when I run the following:

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.


Viewing all articles
Browse latest Browse all 12545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>