Set the server farm (aka web hosting plan) when running New-AzureWebsite Set the server farm (aka web hosting plan) when running New-AzureWebsite azure azure

Set the server farm (aka web hosting plan) when running New-AzureWebsite


You cannot assign a web hosting plan when running the traditional New-AzureWebSite.

To have this power and control, you have to use the newest version of Azure PowerShell and switch to AzureResourceManager mode.

Here is some tested PowerShell code:

Switch-AzureMode -Name AzureResourceManagerAdd-AzureAccountSelect-AzureSubscription "Your Subscription Name"New-AzureResource -Name NewWebSite `    -Location "West Europe" `    -ResourceGroupName 'Default-Web-WestEurope' `    -ResourceType 'Microsoft.Web/sites' `    -ApiVersion '2014-04-01-preview' `    -PropertyObject @{ 'ServerFarm' = 'DefaultServerFarm' }

Note, if your account is associated with multiple subscription you have to explicitly select the subscription under which the targeted Resource Group and Server Farm are. If you only have one subscription you can skip this line (Select-AzureSubscription)