我正在尝试使用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
最佳答案
您需要将适当的模块导入到Azure自动化帐户中。您可以使用Azure门户从Automation Module Gallery导入模块。
更多信息请参考此article。
您也可以通过link导入模块。
等待片刻,您可以在Portal中找到两个cmdlet。
关于azure - Azure自动化:术语“Set-AzureRmAppServicePlan”无法识别,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41560400/