2017-01-10 3 views
1

Ich versuche, einen Serviceplan mithilfe von Set-AzureRmAppServicePlan zu skalieren. Ich verbinde gut, kann alle Ressourcen im Konto auflisten, aber beim Aufruf der App-Plan-Methode wird es nicht gefunden. Was wird hier vermisst?Azure Automation: Der Begriff 'Set-AzureRmAppServicePlan' wird nicht erkannt.

Code:

$connectionName = "AzureRunAsConnection" 
try 
{ 
    # Get the connection "AzureRunAsConnection " 
    $servicePrincipalConnection=Get-AutomationConnection -Name $connectionName   

    "Logging in to Azure..." 
    Add-AzureRmAccount ` 
     -ServicePrincipal ` 
     -TenantId $servicePrincipalConnection.TenantId ` 
     -ApplicationId $servicePrincipalConnection.ApplicationId ` 
     -CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint 
} 
catch { 
    if (!$servicePrincipalConnection) 
    { 
     $ErrorMessage = "Connection $connectionName not found." 
     throw $ErrorMessage 
    } else{ 
     Write-Error -Message $_.Exception 
     throw $_.Exception 
    } 
} 

Select-AzureRmSubscription -SubscriptionId "MYSUB" 

Set-AzureRmAppServicePlan -Name "my-plan" -ResourceGroupName "my-group" -Tier "Standard" -WorkerSize "Small" 

Fehler:

Set-AzureRmAppServicePlan : The term 'Set-AzureRmAppServicePlan' 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. 
At line:35 char:1 
+ Set-AzureRmAppServicePlan -Name "JJJLK" -ResourceGroupN ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : ObjectNotFound: (Set-AzureRmAppServicePlan:String) [], CommandNotFoundException 
    + FullyQualifiedErrorId : CommandNotFoundException 
+0

sah ich, dass aber aus irgendeinem Grunde tut es registrieren oder ich habe nicht den Import unter den Vermögenswerten sehen. Vielleicht muss ich schauen, wenn ich nicht so müde bin. – lucuma

Antwort

3

Sie müssen die entsprechenden Module in Ihre Azure Automation Konto importieren. Sie können Module aus der Automation Module Gallery mit dem Azure Portal importieren.

enter image description here

Weitere Informationen finden Sie in diesem article.

Auch Sie könnten das Modul durch die link importieren.

enter image description here

Warten Sie einen Moment, könnten Sie die beiden Cmdlets in Portal.

enter image description here

+0

'Automation Accounts' ->' GEMEINSAME Ressourcen' -> 'Modules' –

+0

Vielen Dank, ich wusste nicht, dass es mit einem Knopfklick gemacht werden könnte. Ich liebe die Tatsache, dass das azurblaue Team sich so schnell bewegt, aber es macht manchmal die Dokumentation im Internet veraltet! – lucuma

Verwandte Themen