Change Function app hosting plan
How to Migrate from Consumption Plan to App Service Plan
How to Migrate from Consumption Plan to Premium Plan
Issue:
- I want to change my consumption plan to app service plan.
- I want to change my app service plan to consumption plan.
- Is there any way to change Azure function hosting plans?
Solution:
There are 3 types of hosting plan available from function app,
- Consumption plan
- Dedicated App service plan
- Premium plan
Each plan has its own advantage and limitation. You should choose it carefully.
You may see lot of articles and blog which suggest you can change function app hosting plan from consumption to dedicated App Service plan and you will be able to achieve that also, but according to Microsoft recommendation, You should never do this. Your function app will be messed up and you will see a lot of issues.
This has been mentioned on Microsoft Official documentation.
You can switch between Consumption and Premium plans by changing the plan property of the function app resource.
But You can't change consumption plan to Dedicated App Service plan or vice versa.
Ref: https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale
Now we know we can migrate consumption to App service plan hence we should focus on, how to achieve it.
Steps to change function app from consumption to premium,
- Create the premium plan.
- Then update the plan property of the function app so it no longer points to the consumption plan but the premium one.
- This feature is not available in UI right now
- You can use CLI command for this,
az functionapp update --name MyFunctionApp --plan <plan name or plan-resource-id>”
|
CLI Ref: https://docs.microsoft.com/en-us/cli/azure/functionapp?view=azure-cli-latest#az-functionapp-update
The premium plan is supported in some regions only. you can get the list of regions in the below URL if you face any region issue.
https://docs.microsoft.com/en-us/azure/azure-functions/functions-premium-plan#regions
I observed some limitation as of now e.g. It only worked when,
- Both plans are in the same region.
- Both plans are in the same resource group.
More info : https://github.com/Azure/Azure-Functions/issues/1194
For the dedicated app service plan, the only option is: You should create a new function app in different hosting plan and update/deploy your code.
Please don’t try to change function app hosting plan from consumption to Dedicated App Service plan or vice versa. This may be possible in future but not now.
Issue: Azure function is throwing one of the following exceptions · Unable to retrieve Functions Keys · We are not able to retrieve the keys for function · The function runtime is unable to start. · Function host is not running. · Internal Server error. · Service Unavailable. |
Issue: Azure Functions: The Consumption pricing tier is not allowed in this resource group |
Issue: Disable Azure functions |