2015-06-21 83 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/

相關問題