2

I am struggling to get the Drupal Webapp created using powershell with a GalleryTemplate Json file. It creates Serverfarm, Database servers but fails for website creation. I am not able to figure out how to move ahead as website creation need to use the created hostingplan serverfarm.It would be great help to get a expertise help on the below. Thanks in advance.

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"

Prompt User Inputs

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

Output

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}

Thanks & Regards,

Harish

pinkal vansia
  • 10,240
  • 5
  • 49
  • 62
H Bala
  • 1,271
  • 2
  • 14
  • 28
  • Looking forward to get some expert help since I do not know why site creation resource definition in standard JSON template do not find the hostingplan created. :( Hoping someone would have encountered this issue before.. – H Bala Jun 22 '15 at 13:04

1 Answers1

3

It looks like the web app is unable to find the server farm (AKA app service plan) since it's in a different resource group. To fix this, try creating the ServerFarm and web app in the same resource group.

i.e. use this command:

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"

Note that -Name and -serverFarmResourceGroup are both "azurepowershellush".

theadriangreen
  • 2,218
  • 1
  • 14
  • 14
  • Thanks. The suggestion when applied perfectly worked and got me even the sites setup. – H Bala Jun 23 '15 at 17:22
  • 1
    Does this mean it is not possible to create a ServerFarm and webApp in different resource groups? – Squiggle Aug 14 '17 at 14:51
  • 2
    @Squiggle you can but you have to use the full name of the ServerFarm, e.g. /subscriptions//resourceGroups//providers/Microsoft.Web/serverfarms/ – Kai G Feb 28 '18 at 07:20