0
0
Azurecloud~30 mins

Function pricing (consumption vs premium) in Azure - Hands-On Comparison

Choose your learning style9 modes available
Function pricing (consumption vs premium)
📖 Scenario: You are setting up an Azure Function App for a small business. They want to understand the difference between Consumption and Premium pricing plans to choose the best option for their needs.You will create a simple Azure Function App configuration that shows how to set the pricing plan to Consumption first, then switch to Premium.
🎯 Goal: Build an Azure Function App configuration that starts with the Consumption plan and then updates to the Premium plan.
📋 What You'll Learn
Create an Azure Function App resource with the Consumption plan.
Add a configuration variable to specify the number of pre-warmed instances for Premium plan.
Update the Function App to use the Premium plan with the pre-warmed instances.
Complete the configuration with the correct SKU and settings for the Premium plan.
💡 Why This Matters
🌍 Real World
Azure Functions are serverless compute services used to run code on demand. Choosing the right pricing plan affects cost and performance.
💼 Career
Cloud engineers and developers must configure Function Apps correctly to optimize cost and scalability in real projects.
Progress0 / 4 steps
1
Create an Azure Function App with Consumption plan
Create an Azure Function App resource named myFunctionApp with the Consumption pricing plan. Use the SKU name Y1 to specify the Consumption plan.
Azure
Need a hint?

Use azurerm_app_service_plan with tier = "Dynamic" and size = "Y1" for Consumption plan.

2
Add pre-warmed instances variable for Premium plan
Add a variable named pre_warmed_instances and set it to 1. This will be used to configure the number of pre-warmed instances in the Premium plan.
Azure
Need a hint?

Define a variable named pre_warmed_instances and set it to 1.

3
Update the App Service Plan to Premium with pre-warmed instances
Create a new App Service Plan resource named premium_plan with ElasticPremium tier and EP1 size. Use the variable pre_warmed_instances to set the pre_warmed_instance_count property.
Azure
Need a hint?

Use tier = "ElasticPremium" and size = "EP1" in the SKU block. Set pre_warmed_instance_count to the variable pre_warmed_instances.

4
Update Function App to use the Premium plan
Update the app_service_plan_id property of the myFunctionApp resource to use the premium_plan App Service Plan resource ID.
Azure
Need a hint?

Change app_service_plan_id in myFunctionApp to use azurerm_app_service_plan.premium_plan.id.