This post was most recently updated on June 23rd, 2022.2 min read.
Sometimes, you need to change the hosting model (or tier) for your resources on Azure. Maybe you’ve outgrown whatever you’ve originally selected, maybe you’ve got too much cash on your hands, or maybe you’re like me, and you get absolutely and completely fed up with the cold starts for your Azure Function apps on the Consumption plan and want to use the Premium Elastic plan instead.
For these situations, you have the possibility of changing the hosting tier – the plan – you’re on. Although, this has been implemented in a disturbingly non-intuitive way! You’ll hit a roadblock if you try to upgrade/move to an App Service Plan from Consumption using the Azure Portal. Let’s take a closer look…
Table of Contents
What do I mean? Well, if you have selected the Consumption plan originally, and you’ll then try to change the plan, you’ll run into this annoying sight:
Surprise, surprise: There is no UI for this.
And not just that – the UI is just downright lying – you can definitely change the plan. :)
In short: no worries! As always, there’s a workaround.
So, what is the workaround? Luckily – it’s pretty simple! Let’s get to it.
As a prerequisite, you’ll need to have Azure CLI installed. You can get it from here:
Then, on with the actual installation steps!
Time needed: 25 minutes
How to update the plan/tier your Azure Function app is on?
- Log in
Well, we’ll start by authenticating the CLI using the account you use for managing Azure resources.
- Select the subscription
This subscription needs to be the one your Azure Function app is currently located in. Azure CLI requires this to be “locked” for running the commands.
az account set --subscription "[your-subscription-id]"
- Create a new app service plan
The command below creates a new app service plan for a function app. You set the name (and you’ll need it later), select the resource group, set the plan SKU (in my example Elastic Premium 1), and you can set the scaling limits by setting the initial number of instances (min-instances) and the peak (max-burst) during high load.
az functionapp plan create --name "[name-your-elasticpremiumplan]" --resource-group "[name-of-your-existing-resourcegroup]" --sku EP1 --min-instances 1 --max-burst 2
Running this command might sometimes take a looong while. Don’t be alarmed if it takes 10-15 minutes.
If you’re unsure about the SKU you should be using, see the options (somewhat up-to-date, thanks to Microsoft) here.
- Move your existing Function App to the newly created plan
The command below moves your Function App to the newly created plan. Be very mindful of the names you’re entering here – you need to copy-paste the plan name from before!
az functionapp update --plan "[the-elasticpremiumplan-name-from-above]" -n "[azure-function-to-move]" --resource-group "[name-of-your-existing-resourcegroup]"
This can be another slow command to execute.
And boom! You should be good.
Did it help you? Have another issue with your Azure Functions? Let me know in the comments -section below!
- CLI docs for the functionapp commands:
- Download link for the CLI:
- “This app can’t run on your PC” dialog when you’re building your app in Visual Studio - September 12, 2023
- How to “fix” Word removing tagged users from comments? - September 5, 2023
- How to install Home Assistant on Synology NAS (DSM 7.2)? - August 29, 2023