Home > Blockchain >  Moving Azure Functions (linux hosted) from Consumption to Premium Plan
Moving Azure Functions (linux hosted) from Consumption to Premium Plan

Time:05-19

I have an existing Azure function with Consumption plan, however, I need to move it to Premium Plan. While creating the function app, I selected linux for the OS.

So far, I created a premium plan and then running the following through azure-cli:

az functionapp update --name <name-of-the-app> --resource-group <resource-group> --plan <premium-plan>

and it gives me the following message:

This feature currently supports windows to windows plan migrations. For other migrations, please redeploy.

Question:

  • Is there a way to update/move from consumption plan to premium plan without redeploying it?
  • If not, and if the only option I have is to redeploy, is it possible to clone the functions from my existing app?

CodePudding user response:

As of now, this issue - Moving the Azure Linux Function App from Consumption Hosting Plan to Premium Hosting Plan is Open in the GitHub.

This is marked as a feature request.

Even Migration of Consumption Plan to Dedicated Plan is in Open Issue in the GitHub, JeffHollan given a manual approach to migrate, but he too recommended the solution - creating a new app and re-publishing to it.

CodePudding user response:

Found a solution. You can do it by using az resource update command. Official Documentation / GitHub

There are two ways that you can do it:

Using UI for Azure Resources (https://resources.azure.com/)

  • Find your app in: your-subscription/resourceGroup/your-resource-group/Microsoft.Web/sites/
  • Check numOfWorkers. If it is -1, change it to 1 as it should be greater than 0 (this might be the case if the app was created before '21)
  • Then change the serverFarmID to your latest premium plan's resource ID.

Using Azure CLI

  • Install using: brew install azure-cli (macOS)
  • Login using az login
  • Change numOfWorkers to 1 using: az resource update --resource-type "Microsoft.Web/sites" --name <your-app> --resource-group <your-resource-group> --set properties.numOfWorkers=1
  • Now you can change the serverFarmID to point to new premium plan: az resource update --resource-type "Microsoft.Web/sites" --name <your-app> --resource-group <your-resource-group> --set properties.serverFarmId=<premium-plan-resource-id>
  • Related