Azure Functions-How to Migrate from Consumption Plan to App Service Plan | Azure Tutorials
Azure Functions-How to Migrate from Consumption Plan to App Service Plan
This article talks about how to migrate your Azure Functions from Consumption plan to App Service plan. As most of the developers when they start their journey with Azure Functions they start with Consumption.
However, during the course, the requirement will increase and they have to scale the plan. currently, most of the articles give the solution as
- to create a new Dedicated App service plan.
- Create a new function in parallel and then associate it with the new Dedicate App Service plan.
So let's start
- let's create our first function app with a consumption plan
So I have selected the plan as “Consumption(Serverless)”
As our new Function app is ready.
Go to Azure Portal → Open Azure Cloud Shell → type below command now let's check how we can change the App Service Plan without recreating a new plan or recreating a new function app.
Set-AzAppServicePlan -ResourceGroupName “<your resource group name” -Name “<name of your consumption plan>” -PerSiteScaling $true -tier S1
Now let's go back to the Azure portal and refresh the App Service Plan page. Here you can see how the App Service Plan has been changed to the S1 tier.
and let's validate the same in Azure function
Finally, let's validate Azure Function to make sure they are working fine and no errors.
Click on “HttpTrigger1” →click on “Code + test” → Click on Test/Run →Run
you can see Output as → Hello, Azure. This HTTP triggered function executed successfully.