Powershell 未找到Azure服务器场
我正在尝试通过powershell脚本创建azure网站。托管计划已经创建,我只是想添加一个新的网站到它 我使用的脚本是:Powershell 未找到Azure服务器场,powershell,azure,Powershell,Azure,我正在尝试通过powershell脚本创建azure网站。托管计划已经创建,我只是想添加一个新的网站到它 我使用的脚本是: Switch-AzureMode AzureResourceManager $targetServicePlan = Get-AzureResource -Name my-serviceplan -OutputObjectFormat New New-AzureResource -Name MyTestSite -Location "West Europe" `
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
我遗漏了什么?您在“西欧”的$TARGETSERVICE计划是什么?如果不是这样的话,那可能就是这个没有多大帮助的错误的原因。这正是问题所在,它发生在北欧。真令人沮丧。