Azure rules: cost, retirements, security and governance
LeftSize checks your Azure subscriptions against 94 rules with read-only access, from a scheduled GitHub Action, and opens a GitHub or Jira issue for each finding with the affected resources, the estimated monthly savings where it can price them, and how to fix it. The 31 cost optimization rules are in the Free plan; deprecation, security and governance rules are in the Team and Business plans.
Cost optimizationFree31 rules
- AKS clusters with low node CPU and memory usageRunning AKS clusters whose nodes averaged under 20% CPU and under 40% memory (working set) over 7 days
- AKS clusters without autoscalerRunning AKS clusters with 3+ nodes where no node pool has the cluster autoscaler enabled
- AKS node pools on expensive VM sizesRunning AKS clusters with a node pool on an older-generation VM size (Dsv3/Esv3 8+ vCPU, Esv3 4 vCPU, Fs v1) where a newer generation usually gives better price-performance
- App Service Plans on Basic/Standard - review Premium v3App Service Plans with apps on Basic (B1-B3) or Standard (S1-S3) SKUs that may get better price-performance on Premium v3
- Azure Bastion hosts with no sessions in 7 daysAzure Bastion hosts (Basic, Standard, Premium) with no sessions in the last 7 days
- Azure Container Registries without retention policyPremium Azure Container Registries without the untagged-manifest retention policy accumulate untagged manifests
- Azure Load Balancers with no backend membersAzure Load Balancers with no backend pool members (neither NIC-based nor IP-based), which can usually be deleted together with their public IPs
- Azure SQL Databases on the DTU purchasing modelAzure SQL Databases on DTU Standard S3+ or Premium (still supported) that may cost less on vCore
- Cosmos DB accounts with overprovisioned throughputProvisioned-throughput Cosmos DB accounts with average normalized RU consumption of 30% or less over 14 days
- Disk snapshots older than 30 daysOld disk snapshots no longer needed, accumulating storage costs
- Disks attached to deallocated VMsManaged disks attached to deallocated VMs incur storage costs with zero compute value
- Empty App Service PlansApp Service Plans with no deployed applications consuming unnecessary resources
- Empty SQL Elastic PoolsSQL Elastic Pools with no allocated database storage for the last 7 days (no databases), still incurring eDTU/vCore charges
- Idle Application GatewaysRunning Azure Application Gateways whose backend pools have no targets
- Idle VMsVirtual machines with consistently low CPU utilization that may be candidates for stopping or downsizing
- Linux VMs that could move to Arm64 sizesRunning Linux VMs on x64 D/E-series v3-v5 sizes that could move to Arm64 sizes (Dpsv5/Epsv5/Dpsv6) for better price-performance
- Non-prod VMs without auto-shutdownRunning non-production VMs (from tags or resource and resource group names) without an enabled auto-shutdown schedule
- Non-production AKS clusters running outside working hoursRunning non-production AKS clusters (from tags or names) that could be stopped or scaled down outside working hours
- Overprovisioned SQL databasesDTU-model Azure SQL Databases with average DTU consumption of 20% or less over 14 days
- SQL databases with unnecessary Business Critical tierNon-production Azure SQL databases (from tags or names) using the Business Critical tier; General Purpose costs roughly half or less for the same vCores (estimate)
- SQL databases without Azure Hybrid BenefitSingle Azure SQL databases on provisioned vCore General Purpose or Business Critical (not serverless, not in an elastic pool) without Azure Hybrid Benefit
- Stopped VMs still incurring storage costsVirtual machines that have been stopped or deallocated for about 30+ days and still incur costs for their managed disks, public IPs and other attached resources (and for compute too if only stopped, not deallocated)
- Storage accounts in regions with an 8–17% price increase from Feb 1, 2027Storage accounts (GPv2, Blob, Premium block blob, Premium files) in regions with an Azure Storage price increase on 1 February 2027
- Storage accounts on Hot tier with almost no activityGPv2/Blob storage accounts with Hot as default access tier, older than 90 days, with at most 100 transactions in the last 30 days
- Storage accounts paying the SFTP hourly chargeStorage accounts with SFTP enabled (flat hourly charge whether or not SFTP is used)
- Unattached disksManaged disks that are not attached to any virtual machine but still incurring storage costs
- Underutilized App Service PlansApp Service Plans with low CPU and memory utilization that may benefit from downsizing or consolidation
- Underutilized Redis CachesAzure Cache for Redis instances with average memory usage of 20% or less over 14 days
- Unused public IPsPublic IP addresses that are not attached to any resource and generating unnecessary costs
- VMs in regions with an 8–17% price increase from Feb 1, 2027VMs in West Europe, North Europe, France Central/South, Norway East/West or Southeast Asia on a VM series that is not excluded from the 1 February 2027 regional price increase
- Windows VMs without Azure Hybrid BenefitRunning Windows VMs without Azure Hybrid Benefit enabled (savings require eligible Windows Server licenses with Software Assurance or subscriptions)
Deprecations & retirementsTeam41 rules
- Accounts of retired Azure AI services (LUIS, QnA Maker, Anomaly Detector, Metrics Advisor, Personalizer) - already retiredAzure AI services accounts of a retired kind: QnAMaker (retired 2025-10-31), LUIS (2026-03-31), MetricsAdvisor, Personalizer and AnomalyDetector (retired by 2026-10-01)
- AKS clusters on Kubernetes versions out of support or ending by Nov 30, 2026AKS clusters whose control plane or node pools run a Kubernetes minor version that is out of AKS support or ends support by November 30, 2026
- AKS clusters using kubenet networking — migrate to Azure CNI Overlay before Mar 31, 2028AKS clusters using kubenet networking, which is retired on March 31, 2028; migrate to Azure CNI Overlay
- AKS clusters using the Open Service Mesh add-on — retired Sep 30, 2027AKS clusters with the Open Service Mesh add-on enabled, which AKS stops supporting on September 30, 2027
- AKS clusters with Azure Linux 2.0 node pools — images removed from Oct 31, 2026AKS clusters with node pools on Azure Linux 2.0 (CBL-Mariner 2.0) node images, which AKS has been removing since October 31, 2026
- AKS clusters with node pools on VM sizes that retire between March 2027 and November 2029AKS clusters with node pools on VM sizes that Microsoft retires between March 2027 and November 2029
- AKS clusters with Ubuntu 20.04 node pools — images deleted Mar 17, 2027AKS clusters with node pools on Ubuntu 20.04 node images, which AKS stops supporting and deletes on March 17, 2027
- AKS clusters with Ubuntu 22.04 node pools — unsupported Jun 30, 2027AKS clusters with node pools on Ubuntu 22.04, which AKS stops supporting on June 30, 2027 and removes on April 30, 2028
- AKS clusters with unsupported Windows node pools (WS2019 / Annual Channel) — migrate to Windows Server 2022/2025AKS clusters with Windows node pools on Windows Server 2019 or Windows Server Annual Channel, both unsupported; Annual Channel node images are removed on May 15, 2027 and the AKS team has announced Windows Server 2019 image removal for April 1, 2027
- Application Gateways still on the retired V1 SKU (retired Apr 28, 2026) — migrate to V2 nowAzure Application Gateways still on the V1 SKU, which was retired on April 28, 2026 and is no longer supported
- Application Gateways using legacy WAF configuration — upgrade to WAF policy before Mar 15, 2027Application Gateway WAF v2 gateways still using the legacy WAF configuration, which retires on March 15, 2027
- Application Insights resources with query API keys - API keys stop working Mar 31, 2027API keys for querying Application Insights data are retired on March 31, 2027 (extended from 2026); query with Microsoft Entra ID instead
- Azure Cache for Redis Enterprise caches — migrate to Azure Managed Redis before Mar 31, 2027Azure Cache for Redis Enterprise and Enterprise Flash instances must be migrated to Azure Managed Redis before March 31, 2027
- Azure Cache for Redis instances — migrate to Azure Managed Redis before Sep 30, 2028Azure Cache for Redis Basic, Standard and Premium instances must be migrated to Azure Managed Redis before September 30, 2028
- Azure CDN Standard from Microsoft (classic) profiles — migrate to Front Door before Sep 30, 2027Azure CDN Standard from Microsoft (classic) profiles must be migrated to Azure Front Door Standard or Premium before September 30, 2027
- Azure Fluid Relay servers - service retires Jun 2, 2027Azure Fluid Relay retires on June 2, 2027 (usable until June 1, 2027); the replacement is a self-hosted Fluid service
- Azure Front Door (classic) profiles — migrate to Standard/Premium before Mar 31, 2027Azure Front Door (classic) profiles must be migrated to Azure Front Door Standard or Premium before March 31, 2027
- Azure OpenAI accounts with deployments that stop working when their model retiresAzure OpenAI deployments that Microsoft doesn't upgrade (Provisioned, Batch, auto-upgrade off, fine-tuned) stop working when their model version retires
- Azure Spring Apps instances - service retires Mar 31, 2028, migrate to Azure Container AppsAll Azure Spring Apps plans (Basic, Standard, Enterprise) retire on March 31, 2028; migrate to Azure Container Apps or AKS
- Basic Load Balancers — retired Sep 30, 2025, unsupported with no SLAAzure Basic Load Balancer was retired on September 30, 2025 — remaining Basic LBs still run but are unsupported with no SLA; upgrade to Standard
- Basic SKU public IPs still in use (retired Sep 30, 2025) — upgrade to StandardBasic SKU public IP addresses, retired on September 30, 2025, that are still in use without support or SLA
- Cloud Services (extended support) deployments - retires Mar 31, 2027, no extensionsCloud Services (extended support) is deprecated since March 31, 2025 and fully retired on March 31, 2027; no extensions are granted
- Content Moderator accounts - service retires Mar 15, 2027, migrate to Azure AI Content SafetyAzure Content Moderator is deprecated and retires on March 15, 2027 (lifecycle page: March 31, 2027); migrate to Azure AI Content Safety
- Function apps on language versions out of support by Nov 10, 2026Linux function apps on .NET 6-9 isolated, Python 3.10 or older, PowerShell 7.4 or older, or Node.js 20 or older; support has ended or ends by November 10, 2026
- Function apps on the .NET in-process model - support ends Nov 10, 2026Support for the Azure Functions .NET in-process model ends on November 10, 2026; migrate to the isolated worker model
- GPv1 / legacy Blob Storage accounts retired Oct 13, 2026 — upgrade to GPv2General-purpose v1 and legacy Blob Storage accounts were retired on October 13, 2026; remaining accounts are being migrated to GPv2 by Microsoft, which may increase transaction costs
- HDInsight clusters on 4.0/5.0 — retired Mar 31, 2025, migrate to 5.1HDInsight 4.0 and 5.0 were retired on March 31, 2025 — Microsoft may remove, disable or delete these clusters at any time; rebuild on HDInsight 5.1
- Linux Consumption Functions plans - migrate to Flex Consumption before Sep 30, 2028Azure Functions Linux Consumption (Y1) hosting retires on September 30, 2028; v3-runtime apps on it already stopped on September 30, 2026; migrate to Flex Consumption
- MariaDB servers still present — service retired Sep 19, 2025, export data nowAzure Database for MariaDB was retired on September 19, 2025 — servers still listed must have their data exported and be migrated to MySQL Flexible Server
- MySQL flexible servers in or entering paid extended support (5.7 billed since Oct 1, 2026; 8.0 from Feb 1, 2027)Azure Database for MySQL flexible servers on MySQL 5.7 (paid extended support since October 1, 2026) or 8.0 (paid extended support from February 1, 2027)
- NSGs with NSG flow logs — migrate to VNet flow logs before Sep 30, 2027Network security groups with NSG flow logs attached; NSG flow logs retire on September 30, 2027 and the flow log resources are deleted
- OS disks using Standard HDD — migrate before Sep 8, 2028Azure Managed Disks using Standard HDD as OS disks require migration to Standard SSD or Premium SSD before September 8, 2028
- PostgreSQL flexible servers in or entering paid extended support (PG 11–13 billed since Sep 1, 2026; PG 14 from Feb 1, 2027)Azure Database for PostgreSQL flexible servers on PostgreSQL 11, 12, 13 (paid extended support since September 1, 2026) or 14 (paid extended support from February 1, 2027)
- VM scale sets on VM sizes that retire between March 2027 and November 2029Virtual Machine Scale Sets (not AKS-managed) whose model uses a VM size that Microsoft retires between March 2027 and November 2029
- VMs on Av2/B/F/Fsv2/G/Lsv2 sizes retiring November 15, 2028VMs on Av2, Amv2, B (v1), F, Fs, Fsv2, G, Gs and Lsv2 sizes, which Microsoft retires on November 15, 2028
- VMs on D/Ds/Dv2/Dsv2/Ls sizes retiring May 1, 2028VMs on D, Ds, Dv2, Dsv2 and Ls sizes, which Microsoft retires on May 1, 2028
- VMs on Dv3/Dsv3/Ev3/Esv3 sizes retiring November 15, 2029VMs on Dv3, Dsv3, Ev3 and Esv3 sizes, which Microsoft retires on November 15, 2029
- VMs on M192i*_v2 sizes retiring March 31, 2027VMs on isolated Msv2 / Mdsv2 Medium Memory (M192i*_v2) sizes, which Microsoft retires on March 31, 2027
- VMs on NP/HC/HBv2 sizes retiring May 31, 2027VMs on NP (FPGA), HC and HBv2 (HPC) sizes, which Microsoft retires on May 31, 2027
- VMs on retired NVv3/NVv4 sizes (retired Sep 30, 2026) — resize requiredVMs on NVv3 or NVv4 sizes, which Microsoft retired on September 30, 2026; they are deallocated and must be resized to a supported GPU size
- VMs still on unmanaged disks (retired Mar 31, 2026) — convert to managed disksAzure VMs still using unmanaged disks (VHDs in storage accounts) after the March 31, 2026 retirement; they cannot start until converted to managed disks
SecurityTeam14 rules
- AKS clusters with local accounts enabledAKS clusters with local accounts enabled
- Defender plans turned offMicrosoft Defender for Cloud plans that are turned off
- Key Vaults without purge protectionKey Vaults without purge protection
- Managed disks not using a customer-managed keyAttached managed disks not encrypted with a customer-managed key
- Network security groups allowing internet traffic to sensitive portsNetwork security groups that allow internet traffic to sensitive ports
- SQL servers open to the whole internetAzure SQL servers with a firewall rule open to the whole internet
- SQL servers without auditingAzure SQL servers without auditing
- Storage accounts accepting unencrypted HTTPStorage accounts that accept unencrypted HTTP requests
- Storage accounts allowing anonymous blob accessStorage accounts that allow anonymous (public) blob access
- Storage accounts allowing Shared Key accessStorage accounts that allow Shared Key (account key) authorization
- Storage accounts reachable from all networksStorage accounts reachable from all networks
- Storage accounts with a minimum TLS version below 1.2Storage accounts with a minimum TLS version below 1.2
- Web apps accepting plain HTTPApp Service and Function apps that accept plain HTTP
- Web apps allowing TLS 1.0 or 1.1App Service and Function apps that allow TLS 1.0 or 1.1
GovernanceTeam8 rules
- Attached disks on Standard HDD (Standard_LRS)Attached managed disks larger than 32 GiB on Standard HDD (Standard_LRS); review whether Standard SSD or Premium SSD fits the workload better
- Key Vault certificates expiring soonKey Vault certificates approaching expiration that need renewal to avoid service disruption
- Resources missing ownership tags: AKS clustersEnsure all AKS clusters have clear ownership metadata.
- Resources missing ownership tags: managed disksEnsure all Azure Managed Disks have clear ownership metadata.
- Resources missing ownership tags: resource groupsEnsure all Resource Groups have clear ownership metadata. Tags on resource groups can be inherited by child resources through Azure Policy.
- Resources missing ownership tags: SQL serversEnsure all Azure SQL logical servers have clear ownership metadata.
- Resources missing ownership tags: storage accountsEnsure all Azure Storage Accounts have clear ownership metadata.
- Resources missing ownership tags: virtual machinesEnsure all virtual machines have clear ownership metadata for cost tracking and accountability.