Documentation menu

resources

App Service Plan

Overview

This example defines a Windows Consumption plan for Function Apps. For new serverless apps, Microsoft recommends the Linux-based FlexConsumption plan; see the Function App Flex Consumption example.

{
	"app_service_plan": {
		"name": "plan-consump-{env}",
		"kind": "Consumption",
		"os": "windows",
		"type": "function_app",
		"zone_redundant": false,
		"location": "northeurope",
		"external": false,
		"resource_group_name": "my-rg-name",
		"tags": { "example": "S0" }
	}
}

App Service Plan Reference

Key Value Description
name (required) string The name of the plan (see how to name)
kind (required) PlanKind Kind of the App Service Plan
os (required) OsType The target os of the plan
type (required) AppType Plan kind metadata; Function-only SKUs require function_app
diagnostic_settings diagnostic settings Optional supported logs and metrics with storage, Event Hub, or Log Analytics destinations.
instance_count integer Initial capacity for Dedicated and Premium plans (defaults to 1). Consumption always emits the Azure-required capacity 0; Flex doesn’t emit plan capacity.
maximum_elastic_worker_count integer Maximum elastic workers, usually used with an Elastic Premium plan (range 1–100).
zone_redundant bool Whether the plan is redundant inside of the location, will impact instance count (defaults to false)
auto_scale_settings AutoScale The settings for the auto scale
location string Resource Location (defaults to the resource group location)
external bool A reference to an existing App Service Plan (defaults to false)
resource_group_name string The name of the resource group where the resource is located, only with external resources (defaults to the resource group of the deployment)
tags object Additional tags for the resource (defaults to no additional tags)

PlanKind

Value Azure SKU / tier Intended use
Consumption Y1 / Dynamic Classic serverless Function Apps.
FlexConsumption FC1 / FlexConsumption Linux Flex Consumption Function Apps.
EP1, EP2, EP3 same name / ElasticPremium Elastic Premium Function Apps.
B1 B1 / Basic Dedicated apps.
S1 S1 / Standard Dedicated apps.
P1v2, P2v2, P3v2 same name / PremiumV2 Dedicated Premium v2 apps.
P0v3 P0v3 / Premium0V3 Dedicated Premium v3 P0 apps.
P1v3, P2v3, P3v3 same name / PremiumV3 Dedicated Premium v3 apps.
P1mv3, P2mv3, P3mv3, P4mv3, P5mv3 same name / PremiumV3 Memory-optimized Dedicated Premium v3 apps.

Hulk emits the Azure SKU metadata appropriate to each kind. In particular, Consumption uses capacity 0, Flex uses no plan capacity, and Elastic Premium uses the EP family. See Microsoft’s hosting plan Bicep guidance.

OsType

Value Description
windows A plan running on Windows
linux A plan running on Linux

AppType

Value Description
function_app Emits Function App plan kind metadata. Required for Consumption, Flex Consumption, and Elastic Premium.
web_app Emits Web App plan kind metadata for a Dedicated plan.

Web Apps require a Dedicated SKU (B1, S1, or a Premium v2/v3 option). A Dedicated App Service Plan can host both Web Apps and Function Apps regardless of whether its type metadata is web_app or function_app; this supports existing mixed plans without replacing them. Consumption, FlexConsumption, and EP1–EP3 are Function-only plans and must use type: "function_app". A Flex plan must also use os: "linux".


AutoScale

Key Type Description
name string Name of the AutoScale Setting
enabled bool Wether the AutoScale should be enabled
notifications array of AutoScaleNotifications Notification Settings of the AutoScale Setting
profiles array of AutoScaleProfiles Profiles of the AutoScale Setting

AutoScaleNotifications

Value Type Description
operation ScaleOperation Operation that will trigger the notifications
emails array of string Custom emails to notify
send_to_subscription_administrator bool Wether an email should be sent to subscription administrators

ScaleOperation

Value Description
Scale Triggers when the scale changes

AutoScaleProfiles

Value Type Description
name string A plan running on Windows
capacity AutoScaleCapacity Capacity of the Profile
rules array of object AutoScaleRules List of rules for the Profile

AutoScaleCapacity

Value Type Description
default number Default instance count of the Profile
minimum number Minimum instance count of the Profile
maximum number Maximum instance count of the Profile

AutoScaleRules

Value Type Description
metric_trigger MetricTrigger Metric trigger of the rule
scale_action ScaleAction Scale action of the rule

MetricTrigger

Value Type Description
metric_name MetricName Name of the metric to monitor for triggers
time_grain TimeSpan Granularity of Metrics
statistic Statistic Metric statistic type
time_window TimeSpan Time range in which instance data is collected
time_aggregation TimeAggregation Time aggregation type
operator Operator Operator used for comparing metric data and threshold
threshold number The threhold of the metric

MetricName

Value
CpuPercentage
MemoryPercentage
DiskQueueLength
HttpQueueLength
BytesReceived
BytesSent
TcpSynSent
TcpSynReceived
TcpEstablished
TcpFinWait1
TcpFinWait2
TcpClosing
TcpCloseWait
TcpLastAck
TcpTimeWait
SocketInboundAll
SocketOutboundAll
SocketOutboundEstablished
SocketOutboundTimeWait
SocketLoopback

Statistic

Value
Average
Count
Max
Min
Sum

TimeAggregation

Value
Average
Count
Last
Maximum
Minimum
Total

Operator

Value
Equals
GreaterThan
GreaterThanOrEqual
LessThan
LessThanOrEqual
NotEquals

ScaleAction

Value Type Description
direction ScaleDirection The scale direction
type ScaleType The action type when scaling
value number The number of instances involvded in the scaling action
cooldown TimeSpan The amount of time to wait between scale actions

ScaleDirection

Value
Decrease
Increase
None

ScaleType

Value
ChangeCount
ExactCount
PercentChangeCount