0
0
Azurecloud~5 mins

App Service plans and pricing tiers in Azure - Commands & Configuration

Choose your learning style9 modes available
Introduction
When you want to run web apps on Azure, you need to choose how much power and features your app gets. App Service plans let you pick the size and cost of the server resources your app uses. Pricing tiers decide what features and performance you get for your money.
When you want to host a simple website with low traffic and keep costs low.
When you need to run multiple apps on the same server to save money.
When your app needs more CPU and memory to handle more users.
When you want features like custom domains, SSL, or autoscaling.
When you want to test your app in a development environment before going live.
Commands
This command creates an Azure App Service plan named 'myAppServicePlan' in the resource group 'myResourceGroup' using the Basic B1 pricing tier on Linux. It sets up the server resources your app will use.
Terminal
az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku B1 --is-linux
Expected OutputExpected
{ "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Web/serverfarms/myAppServicePlan", "location": "eastus", "name": "myAppServicePlan", "properties": { "status": "Ready", "targetWorkerCount": 1, "targetWorkerSizeId": 1 }, "sku": { "capacity": 1, "family": "B", "name": "B1", "size": "B1", "tier": "Basic" }, "type": "Microsoft.Web/serverfarms" }
--sku - Sets the pricing tier and size of the App Service plan.
--is-linux - Specifies that the plan is for Linux-based apps.
This command shows details about the App Service plan you created, so you can verify its pricing tier and settings.
Terminal
az appservice plan show --name myAppServicePlan --resource-group myResourceGroup
Expected OutputExpected
{ "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Web/serverfarms/myAppServicePlan", "location": "eastus", "name": "myAppServicePlan", "properties": { "status": "Ready", "targetWorkerCount": 1, "targetWorkerSizeId": 1 }, "sku": { "capacity": 1, "family": "B", "name": "B1", "size": "B1", "tier": "Basic" }, "type": "Microsoft.Web/serverfarms" }
This command upgrades the App Service plan to the Standard S1 pricing tier, giving your app more features and better performance.
Terminal
az appservice plan update --name myAppServicePlan --resource-group myResourceGroup --sku S1
Expected OutputExpected
{ "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Web/serverfarms/myAppServicePlan", "location": "eastus", "name": "myAppServicePlan", "properties": { "status": "Ready", "targetWorkerCount": 1, "targetWorkerSizeId": 2 }, "sku": { "capacity": 1, "family": "S", "name": "S1", "size": "S1", "tier": "Standard" }, "type": "Microsoft.Web/serverfarms" }
--sku - Changes the pricing tier and size of the App Service plan.
This command lists all App Service plans in your resource group so you can see all your plans and their pricing tiers.
Terminal
az appservice plan list --resource-group myResourceGroup
Expected OutputExpected
[ { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Web/serverfarms/myAppServicePlan", "location": "eastus", "name": "myAppServicePlan", "properties": { "status": "Ready", "targetWorkerCount": 1, "targetWorkerSizeId": 2 }, "sku": { "capacity": 1, "family": "S", "name": "S1", "size": "S1", "tier": "Standard" }, "type": "Microsoft.Web/serverfarms" } ]
Key Concept

If you remember nothing else from this pattern, remember: App Service plans control the power and features your web apps get, and pricing tiers decide the cost and capabilities.

Common Mistakes
Creating an App Service plan without specifying the pricing tier (sku).
Azure defaults to a free tier which has limited features and may not support your app needs.
Always specify the --sku flag with the desired pricing tier when creating the plan.
Trying to run a Linux app on a Windows App Service plan or vice versa.
App Service plans are OS-specific; mixing them causes deployment failures.
Use --is-linux flag for Linux apps and omit it for Windows apps when creating the plan.
Not upgrading the App Service plan when app traffic grows.
Your app may slow down or crash due to insufficient resources.
Use az appservice plan update to change the pricing tier as your app needs grow.
Summary
Create an App Service plan with az appservice plan create and specify the pricing tier with --sku.
Check your plan details with az appservice plan show to confirm settings.
Upgrade your plan with az appservice plan update to get more power or features.
List all plans in a resource group with az appservice plan list to manage multiple plans.