【问题标题】:Azure Server Farm Not Found未找到 Azure 服务器场
【发布时间】:2015-08-28 06:58:56
【问题描述】:

我正在尝试通过 powershell 脚本创建一个 azure 网站。托管计划已经创建,我只是想添加一个新网站。

我使用的脚本是这样的:

Switch-AzureMode AzureResourceManager

$targetServicePlan = Get-AzureResource -Name my-serviceplan -OutputObjectFormat New

New-AzureResource -Name MyTestSite -Location "West Europe" `
    -ResourceGroupName Default-Web-WestEurope `
    -ResourceType 'Microsoft.Web/sites' `
    -PropertyObject @{"name" = "MyTestSite"; "ServerFarmId" = $targetServicePlan.ResourceId } `
    -OutputObjectFormat New

服务器场 ($targetServicePlan) 有一个资源 id,所以我假设它存在(在 azure 门户中也有一个使用此名称的托管计划)。然而,当我尝试创建网站时,出现错误:“找不到名称为 my-serviceplan 的服务器场。”

完整的错误是:

New-AzureResource : {"Code":"NotFound","Message":"Server farm with name my-serviceplan not found.","Target":null,"Details":[{"Message":"Server farm with name
my-serviceplan not found."},{"Code":"NotFound"},{"ErrorEntity":{"Code":"NotFound","Message":"Server farm with name my-serviceplan not
found.","ExtendedCode":"11001","MessageTemplate":"Server farm with name {0} not found.","Parameters":["my-serviceplan"],"InnerErrors":null}}],"Innererror":null}
At line:1 char:1
+ New-AzureResource -Name MyTestSite -Location "West Europe" -ResourceGrou ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzureResource], ErrorResponseMessageException
+ FullyQualifiedErrorId : NotFound,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceCmdlet

我错过了什么?

【问题讨论】:

    标签: powershell azure


    【解决方案1】:

    您的 $targetServicePlan 在“西欧”吗?如果不是,那可能是那个不太有用的错误的原因。

    【讨论】:

    • 这正是问题所在,它在北欧。多么令人沮丧。
    猜你喜欢
    • 1970-01-01
    • 2014-11-09
    • 1970-01-01
    • 2016-02-28
    • 1970-01-01
    • 2020-12-06
    • 2013-07-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多