CloudWiki
Resource

App-Service Plan

Microsoft Azure
App Services
Azure App Service Plan enables users to host and run web and mobile applications on the cloud. It provides a fully managed platform with various features such as automatic scaling and load balancing, and offers different tiers with varying capabilities and pricing. Azure App Service Plan supports different programming languages and frameworks, and integrates with other Azure services to enable seamless development, deployment, and management of applications.
Terraform Name
terraform
azurerm_service_plan
App-Service Plan
attributes:

The following arguments are supported:

  • name - (Required) The name which should be used for this Service Plan. Changing this forces a new AppService to be created.
  • location - (Required) The Azure Region where the Service Plan should exist. Changing this forces a new AppService to be created.
  • os_type - (Required) The O/S type for the App Services to be hosted in this plan. Possible values include Windows, Linux, and WindowsContainer. Changing this forces a new resource to be created.
  • resource_group_name - (Required) The name of the Resource Group where the AppService should exist. Changing this forces a new AppService to be created.
  • sku_name - (Required) The SKU for the plan. Possible values include B1, B2, B3, D1, F1, I1, I2, I3, I1v2, I2v2, I3v2, I4v2, I5v2, I6v2, P1v2, P2v2, P3v2, P1v3, P2v3, P3v3, P1mv3, P2mv3, P3mv3, P4mv3, P5mv3, S1, S2, S3, SHARED, EP1, EP2, EP3, WS1, WS2, WS3, and Y1.

NOTE:

Isolated SKUs (I1, I2, I3, I1v2, I2v2, and I3v2) can only be used with App Service Environments

NOTE:

Elastic and Consumption SKUs (Y1, EP1, EP2, and EP3) are for use with Function Apps.

  • app_service_environment_id - (Optional) The ID of the App Service Environment to create this Service Plan in.

NOTE:

Requires an Isolated SKU. Use one of I1, I2, I3 for azurerm_app_service_environment, or I1v2, I2v2, I3v2 for azurerm_app_service_environment_v3

  • maximum_elastic_worker_count - (Optional) The maximum number of workers to use in an Elastic SKU Plan. Cannot be set unless using an Elastic SKU.
  • worker_count - (Optional) The number of Workers (instances) to be allocated.
  • per_site_scaling_enabled - (Optional) Should Per Site Scaling be enabled. Defaults to false.
  • zone_balancing_enabled - (Optional) Should the Service Plan balance across Availability Zones in the region. Changing this forces a new resource to be created.

NOTE:

If this setting is set to true and the worker_count value is specified, it should be set to a multiple of the number of availability zones in the region. Please see the Azure documentation for the number of Availability Zones in your region.

  • tags - (Optional) A mapping of tags which should be assigned to the AppService.

Associating resources with a
App-Service Plan
Resources do not "belong" to a
App-Service Plan
Rather, one or more Security Groups are associated to a resource.
Create
App-Service Plan
via Terraform:
The following HCL manages an App Service: Service Plan
Syntax:

provider "azurerm" {
 features {}
}

resource "azurerm_resource_group" "example" {
 name     = "example-resources"
 location = "West Europe"
}

resource "azurerm_service_plan" "example" {
 name                = "example"
 resource_group_name = azurerm_resource_group.example.name
 location            = azurerm_resource_group.example.location
 os_type             = "Linux"
 sku_name            = "P1v2"
}

Create
App-Service Plan
via CLI:
Parameters:

az appservice plan create --name
                         --resource-group
                         [--app-service-environment]
                         [--hyper-v]
                         [--is-linux]
                         [--location]
                         [--no-wait]
                         [--number-of-workers]
                         [--per-site-scaling]
                         [--sku {B1, B2, B3, D1, F1, FREE, I1, I1v2, I2, I2v2, I3, I3v2, I4v2, I5v2, I6v2, P0V3, P1MV3, P1V2, P1V3, P2MV3, P2V2, P2V3, P3MV3, P3V2, P3V3, P4MV3, P5MV3, S1, S2, S3, SHARED, WS1, WS2, WS3}]
                         [--tags]
                         [--zone-redundant]

Example:

az appservice plan create -g MyResourceGroup -n MyPlan

aws cost
Costs
Direct Cost
Indirect Cost
No items found.
Best Practices for
App-Service Plan

Categorized by Availability, Security & Compliance and Cost

Low
Access allowed from VPN
No items found.
Low
Auto Scaling Group not in use
No items found.
Medium
Connections towards DynamoDB should be via VPC endpoints
No items found.
Medium
Container in CrashLoopBackOff state
No items found.
Low
EC2 with GPU capabilities
No items found.
Medium
EC2 with high privileged policies
No items found.
Medium
ECS cluster delete alarm
No items found.
Critical
ECS task with Admin access (*:*)
Medium
ECS task with high privileged policies
No items found.
Critical
EKS cluster delete alarm
No items found.
Medium
ElastiCache cluster delete alarm
No items found.
Medium
Ensure Container liveness probe is configured
No items found.
Medium
Ensure ECS task definition has memory limit
No items found.
Critical
Ensure EMR cluster master nodes are not publicly accessible
No items found.
More from
Microsoft Azure