2015-06-21 53 views
2

我很努力地使用PowerShell创建的Drupal Webapp与GalleryTemplate Json文件。它创建Serverfarm,数据库服务器,但无法创建网站。由于网站创建需要使用创建的hostingplan serverfarm,因此我无法弄清楚如何继续前进。在下面获得专业知识帮助将非常有帮助。提前致谢。网站创建失败,serverfarm未找到Azure Powershell

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} 

感谢&问候,

哈里什

+0

期待获得一些专家的帮助,因为我不知道为什么标准JSON模板中的网站创建资源定义没有找到创建的hostingplan。 :(希望有人会遇到这个问题之前.. –

回答

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" 

需要注意的是杂牌和-serverFarmResourceGroup都是 “azurepowershellush”。

+0

谢谢。建议当应用完美的工作,并让我甚至网站设置 –

+1

这是否意味着不可能创建一个ServerFarm和WebApp在不同的资源组? – Squiggle

+1

@ Squiggle可以,但必须使用ServerFarm的全名,例如/ subscriptions//resourceGroups/<资源组名称> /providers/Microsoft.Web/serverfarms/

相关问题