Is there a way to scale an Azure WebSite instance size (not instance count) using PowerShell? I haven't found the way.
I know it can be done using Azure CLI or from the Portal, but I want to be able to do it with PowerShell. Is this posible?
I want to update an existing WebSite instance size, not create a new website.
Yes, you first need to know the name of the Resource Group and Web Hosting Plan to which your website belongs, which you can get from the new Azure Portal. Then you can change the worker size to 0 (Small), 1 (Medium) or 2 (Large).
Switch-AzureMode AzureResourceManager
$resourceGroup = "MyResourceGroup"
$webHostingPlan = "MyWebHostingPlan"
$whp = Get-AzureResource `
-Name $webHostingPlan `
-ResourceGroupName $resourceGroup `
-ResourceType "Microsoft.Web/serverFarms" `
-ApiVersion 2014-04-01
$newWorkerSize = 1
$whp.Properties.workerSize = $newWorkerSize
$whp.Properties.workerSizeId = $newWorkerSize
Set-AzureResource `
-Name $webHostingPlan `
-ResourceGroupName $resourceGroup `
-ResourceType "Microsoft.Web/serverFarms" `
-ApiVersion 2014-04-01 `
-PropertyObject $whp.Properties
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With