2017-01-10 1 views
1

J'essaie d'étendre un plan de service en utilisant Set-AzureRmAppServicePlan. Je me connecte bien, je peux lister toutes les ressources du compte mais quand j'appelle la méthode du plan d'application, elle n'est pas trouvée. Qu'est-ce qui manque ici?Azure Automation: le terme "Set-AzureRmAppServicePlan" n'est pas reconnu

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" 

Erreur:

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

j'ai vu cela, mais pour une raison quelconque, il na pas s'inscrire ou je ne voyais pas l'importation à l'actif. Peut-être besoin de regarder quand je ne suis pas si fatigué. – lucuma

Répondre

3

Vous devez importer les modules appropriés dans votre Azure compte d'automatisation. Vous pouvez importer des modules depuis Automation Module Gallery avec le portail Azure.

enter image description here

Plus d'informations s'il vous plaît se référer à ce article. Vous pouvez également importer le module par link.

enter image description here

Attendez un instant, vous pouvez trouver les deux cmdlet Portal.

enter image description here

+0

'Comptes d'automatisation' ->' Ressources partagées' -> 'Modules' –

+0

Merci, je ne savais pas que cela pouvait être fait avec un clic de bouton. J'adore le fait que l'équipe azur bouge si vite mais ça rend parfois la documentation trouvée sur internet périmée! – lucuma