3

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?
Dhrumil
  • 67
  • 11

2 Answers2

3

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>
Dhrumil
  • 67
  • 11
  • This doesn't work, if you want to update a Linux Function App from consumption to Elastic Premium. I just tested both ways with multiple function apps and as expected is has no effect, the function runtime stays unavailable. The correct answer is the one from Hari Krishna, that it is currently not supported and not possible without redeployment. – itpropro Jun 01 '23 at 15:00
2

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.

  • Thanks, you did point me in the right direction. The command we can use is 'az resources', adding a new reply for visibility. – Dhrumil May 18 '22 at 13:46