2017-01-10 5 views
1

Я пытаюсь расширить план обслуживания с помощью Set-AzureRmAppServicePlan. Я хорошо подключаюсь, могу перечислять все ресурсы в учетной записи, но при вызове метода плана приложения он не найден. Что здесь упущено?Azure Automation: термин «Set-AzureRmAppServicePlan» не распознается

Код:

$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" 

Ошибка:

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

Я видел это, но по какой-то причине оно не зарегистрировать или я не видел импорт под активы. Может быть, нужно смотреть, когда я не так устал. – lucuma

ответ

3

Вам необходимо импортировать соответствующие модули в свой аккаунт автоматизации Azure. Вы можете импортировать модули из галереи модулей автоматизации с Azure Portal.

enter image description here

Более подробную информацию можно найти в этой article.

Также вы можете импортировать модуль на link.

enter image description here

Подождите минуту, вы могли бы найти два командлета в Portal.

enter image description here

+0

'Автоматические учетные записи' ->' SHARED Resources' -> 'Модули' –

+0

Спасибо, не понимал, что это можно сделать с помощью нажатия кнопки. Мне нравится тот факт, что команда лазури движется так быстро, но иногда делает документацию, найденную в Интернете устаревшей! – lucuma