Is there any way to scale up the azure webapp vertically (change app service plan) automatically?

Rahul Kamble 20 Reputation points
2024-10-18T04:35:37.13+00:00

Is there a way to automatically scale up an Azure Web App vertically (by changing the App Service Plan)? Has this functionality been completely removed by Azure?

I attempted to use an Azure Automation Account with a PowerShell Runbook, but encountered errors. Additionally, the available articles and commands found online reference deprecated commands.

I need this functionality to downscale the app service plan during now working hours.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,307 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 103.2K Reputation points
    2024-10-18T05:06:14.2733333+00:00

    Hi Rahul,

    There's no automatic way to scale up/down, but you can do it using script. For example, say you wanted to scale down to Basic B1 during off hours, sample code below:

    Set-AzAppServicePlan -ResourceGroupName my-resource-group -Name ASP-myappservice-plan -Tier Basic -WorkerSize Small
    
    

    Right before working hours you could use below command to scale up to Basic B3:

    Set-AzAppServicePlan -ResourceGroupName my-resource-group -Name ASP-myappservice-plan -Tier Basic -WorkerSize Large
    
    

    One thing to keep in mind is before you attempt to scale down to a lower plan you must disable/remove features that are not supported by the lower tier, if you are using them. And then when scaling back up to higher tier reinstate/configure those features. For example, custom domains are not supported by Free tier, so before you can scale down to Free you need to remove binding(s) first.

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Rahul Kamble 20 Reputation points
    2024-10-21T05:40:48.94+00:00

    Hey, thanks! The command worked.

    Could someone also help me with a similar PowerShell command to scale up an instance of Application Gateway V1? I'll be using these commands in an Azure Automation Account.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.