网站创建失败,找不到serverfarm Azure Powershell

时间:2015-06-21 04:59:48

标签: json powershell azure server-farm

我正在努力使用带有GalleryTemplate Json文件的PowerShell创建Drupal Webapp。它创建Serverfarm,数据库服务器但无法创建网站。我无法弄清楚如何继续前进,因为网站创建需要使用创建的hostingplan serverfarm。在下面获得专业知识帮助将会很有帮助。提前谢谢。

GalleryTemplateIdentity :: Acquiacom.AcquiaDrupal7SQL.0.3.16-preview

PS C:\scripts> New-AzureResourceGroup -Name azurepowershellush -TemplateFile F:\DeployerScript\Acquiacom.AcquiaDrupal7SQL.0.3.16-preview.json -StorageAccountName pilot -Location "East US"

提示用户输入

WARNING: The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.
cmdlet New-AzureResourceGroup at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
siteName: azureappush
hostingPlanName: DefaultServerFarm
serverFarmResourceGroup: DefaultServerFarm
siteLocation: East US
serverName: azureappush
serverLocation: East US
administratorLogin: adminXprt_1
databaseName: adminXprt_1
webDeploy_DatabaseUsername: adminXprt_1
webDeploy_DatabasePassword: Sample_1987

输出

New-AzureResourceGroup : 10:11:41 AM - Resource Microsoft.Web/Sites 'azureappush' failed with message 'Cannot find ServerFarm with 
name DefaultServerFarm.'

ResourceGroupName : azurepowershellush
Location          : eastus
Resources         : {azureappush, adminXprt_1, azurepowerush, azurepowerush1...}
ResourcesTable    : 
                    Name               Type                             Location
                    =================  ===============================  ========
                    azureappush        Microsoft.Sql/servers            eastus  
                    adminXprt_1        Microsoft.Sql/servers/databases  eastus  
                    azurepowerush      Microsoft.Sql/servers            eastus  
                    azurepowerush1     Microsoft.Sql/servers            eastus  
                    adminxprt_1        Microsoft.Sql/servers/databases  eastus  
                    adminxprt_1        Microsoft.Sql/servers/databases  eastus  
                    Default1           Microsoft.Web/serverFarms        eastus  
                    DefaultServerFarm  Microsoft.Web/serverFarms        eastus  

ProvisioningState : Succeeded
Permissions       : {Microsoft.Azure.Commands.Resources.Models.Authorization.PSPermission}

谢谢&的问候,

哈里什

1 个答案:

答案 0 :(得分:2)

看起来Web应用程序无法找到服务器场(AKA应用程序服务计划),因为它位于不同的资源组中。 要解决此问题,请尝试在同一资源组中创建ServerFarm和Web应用程序。

即。使用此命令:

PS C:\scripts> New-AzureResourceGroup -Name "azurepowershellush" -TemplateFile F:\DeployerScript\Acquiacom.AcquiaDrupal7SQL.0.3.16-preview.json -StorageAccountName pilot -Location "East US" -siteName "azureappush"
-hostingPlanName "DefaultServerFarm" -serverFarmResourceGroup "azurepowershellush" -siteLocation "East US" -serverName "azureappush" -serverLocation "East US" -administratorLogin "adminXprt_1" -databaseName "adminXprt_1" -webDeploy_DatabaseUsername "adminXprt_1" -webDeploy_DatabasePassword "Sample_1987"

请注意,-Name和-serverFarmResourceGroup都是“azurepowershellush”。