๐ก๏ธ Azure App Service Plan is underutilized๐ข
- Contextual name: ๐ก๏ธ App Service Plan is underutilized๐ข
- ID:
/ce/ca/azure/app-service/plan-underutilized - Tags:
- ๐ข Policy with categories
- ๐ข Policy with type
- ๐ข Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
COST
Statsโ
not available
Logicโ
- ๐ง prod.logic.yaml๐ข
Descriptionโ
Descriptionโ
This policy identifies paid Azure App Service Plans that may be oversized for the applications they host. A plan is underutilized when its 30-day average CPU usage is below 20% and its average memory usage is below 40%.
Rationaleโ
App Service Plan charges are driven by the selected SKU and worker capacity, whether or not that capacity is used. Rightsizing consistently underutilized plans can reduce costs without changing application code.
Impactโ
Changing a plan SKU or worker count affects every app and deployment slot hosted by the plan. Review peak and seasonal demand, autoscale settings, application dependencies, and the rollback plan before making a change.
Auditโ
This policy evaluates an Azure App Service Plan based on its 30-day performance metrics.
The App Service Plan is marked as
INCOMPLIANTif:
Monitor: CPU, 30-Day< 20%.and
Monitor: Memory, 30-Day< 40%.The App Service Plan is marked as
INAPPLICABLEif it is in a Free, Shared, Dynamic, WorkflowStandard, or FlexConsumption tier, or ifNumber Of Sitesis 0.... see more
Remediationโ
Remediationโ
Review peak and seasonal demand, autoscale settings, deployment slots, dependencies, and rollback options before changing the plan. A plan is shared by its hosted apps, so validate the proposed capacity with each application owner. Do not delete a non-empty plan.
Resize the planโ
Choose a lower SKU or reduce the worker count only after confirming that the new capacity supports peak demand.
Azure CLIโ
az appservice plan update \
--name {{app-service-plan-name}} \
--resource-group {{resource-group-name}} \
--sku {{target-sku}} \
--number-of-workers {{target-worker-count}}PowerShellโ
Set-AzAppServicePlan `
-Name "{{app-service-plan-name}}" `
-ResourceGroupName "{{resource-group-name}}" `
-Tier "{{target-tier}}" `
-WorkerSize "{{target-worker-size}}" `
-NumberofWorkers {{target-worker-count}}Monitor application availability and response times after the change. Restore the previous SKU or worker count if capacity is insufficient.
policy.yamlโ
Linked Framework Sectionsโ
| Section | Sub Sections | Internal Rules | Policies | Flags | Compliance |
|---|---|---|---|---|---|
| ๐ผ Cloudaware Framework โ ๐ผ Resource Right-Sizing | 20 | no data |