How to upgrade from Consumption plan to Premium plan in Azure

Cosmin Vladutu
3 min readAug 8, 2022

--

Disclaimer: After this upgrade, your functions will be way faster!

Even if “The Consumption plan scales automatically, even during periods of high load.” (from Microsoft documentation that can be found here), they do not say anything about the “power” of the machines on which your functions run. Only from the memory point of view, the consumption plan has machines with 1.5 max memory per instance while, on premium, it starts from 3.5 and goes to 14, based on the SKU you selected. The table with the diffs between the plans can be found here (I’ve searched a bit until I found it).

Before explaining the upgrade itself, I want to pinpoint some things:

  1. The first one is about billing:
    a) While on the consumption plan, you pay only for the time your functions run (number of execution, memory and execution time), “Premium plan is based on the number of core seconds and memory used across needed and pre-warmed instances. At least one instance per plan must always be kept warm.”
    b) Keep in mind, that on premium, you’ll always pay for one instance, while on consumption, if your functions aren’t doing a thing, you won’t pay anything.
  2. I suggest using elastic premium, and not dedicated. I really don’t get why dedicated really exists. If you want serverless, functions and so on, why would you go back to dedicated servers?! On elastic, you can set the maximum burst (the max number of instances that the plan created can scale out under stress, and for specific functions, you can Maximum Scale Out Limit, which is the maximum number of instances that the function can scale out under stress. You also have an “always ready” / prewarmed instances which is the number of instances ready to be used in case of heavy load and in theory at least, you won’t even feel when the new instance started to work.
Scale-out

3. The SKUs, can be changed as on app services after the plan was created. On elastic, you have EP1 (1 core 3.5 GB memory), EP2 (2 cores, 7GB), and EP3 (4 cores with 15GB). If you started on the consumption and it worked for you so far, I’d suggest not to jump to EP2/3. Start small, with EP1 and see how it goes.

4. The storage on consumption was 5TB while the premium is 250GB.

Now let’s talk about the upgrade itself.

Prerequisite: Azure CLI (because you don’t have any UI to do it in any other way — only with your mouse), and patience. The step of creating the plan and the one for updating your resource group might take up to 30 minutes.

  1. The first thing you need to do is to log in:
    az login
  2. Select the current subscription, since, behind the scene, it must be locked before moving your function to the plan you create:
    az account set --subscription "[your-subscription-id]"
  3. Create the new plan:
    az functionapp plan create --name "[name-your-premiumplan]" --resource-group "[name-of-your-resourcegroup]" --sku [name-your-sku-for-example-EP1] --min-instances 1 --max-burst 4
  4. Move your existing function to the newly created plan:
    az functionapp update --plan "[name-your-premiumplan]" -n "[azure-function-to-move]" --resource-group "[name-of-your-resourcegroup]"
Portal — Azure functions

5. Refresh everything and you’ll see that your Scale-out is now working (it’s not deactivated anymore) and your plan is changed.

--

--

Cosmin Vladutu
Cosmin Vladutu

Written by Cosmin Vladutu

Software Engineer | Azure & .NET Full Stack Developer | Leader

No responses yet