2017-01-10 26 views
1

我正在嘗試使用Set-AzureRmAppServicePlan來擴展服務計劃。我連接良好,可以列出帳戶中的所有資源,但在調用應用程序計劃方法時,找不到。這裏錯過了什麼?Azure自動化:術語'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門戶從自動化模塊庫導入模塊。

enter image description here

更多信息,請參閱本article

您也可以通過link導入模塊。

enter image description here

稍等片刻,你會發現在門戶網站兩個小命令。

enter image description here

+0

'自動化帳戶' - >'共享資源' - >'模塊' –

+0

謝謝,沒有意識到它可以通過點擊按鈕完成。我喜歡這個天藍色的團隊如此迅速地移動,但它使得在互聯網上找到的文檔有時會過時! – lucuma