gpt4 book ai didi

Azure 自动化 : The term 'Set-AzureRmAppServicePlan' is not recognized

转载 作者:行者123 更新时间:2023-12-01 19:36:11 27 4
gpt4 key购买 nike

我正在尝试使用 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 门户从自动化模块库导入模块。

enter image description here

更多信息请引用此article .

您还可以通过 link 导入模块.

enter image description here

稍等一下,您可以在Portal中找到这两个cmdlet。

enter image description here

关于Azure 自动化 : The term 'Set-AzureRmAppServicePlan' is not recognized,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41560400/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com