Azure App Service Plan – Specify App Size with PowerShell

azureazure-app-servicescommandpowershellweb-applications

I'm trying to deploy an app service plan (ASP) in the premium tier using powershell. I can deploy the ASP successfully but the ASP defaults to P2v1 which is not what I want. I need the ASP to be set to P2V2 in the premium tier.

I can't figure out or find how to specify the size when executing the powershell command. Here's my command:

New-AzAppServicePlan -Name $AppServicePlan -Location $location -ResourceGroupName $ResourceGroup -Tier "PremiumV2"

If somebody can explain how I can update my command so the ASP is set to Premium P2V2 I would greatly appreciate it.

Best Answer

The PowerShell command for this is confusing for two reasons:

  1. The docs are missing the property you need for this, "WorkerSize"
  2. The values for this property don't line up with the actual sizes you want, they are listed as small, medium, large

The command you need to get a P2V2 plan is:

New-AzAppServicePlan -Name $AppServicePlan -Location $location -ResourceGroupName $ResourceGroup -Tier "PremiumV2" -WorkerSize Medium
Related Topic