Azure Orphan Resources
Published Jun 12 2022 12:44 AM 66.5K Views
Microsoft

Orphaned resources are quite a common theme in Azure environments.

The main purposes of deleting the orphaned resources are to save the cost of unused resources, prevent misconfiguration and simplify operations.

 

TLDR: GitHub for the Workbook

 

What is an Orphaned Resource?

Orphaned resource is an unused resource that can exists in Azure environment.

In some cases (examples below) you pay for the resources even though they are orphans and in other cases the resources have no cost but they can be the cause of misconfiguration and complexity operational.

 

Customer story

As part of my role I worked with a wide variety of customers and all of them have orphan resources.

 

One of the customers I worked with, based on this workbook:

  • Discover +1k orphan resources. (RGs, NICs, Disks, etc.)
  • Save ~$7k/m by deleting unused orphan disks
  • Save ~$100/m by deleting unused orphan Public IPs
  • Delete ~300 empty resource groups
  • Delete ~250 unused network interfaces
  • Delete ~ 30 unused network security groups
  • Delete ~ 10 unused Route tables

 

Examples

Cost perspective

  • Orphaned Disks
    • An orphaned Disk continues to charge a cost as long as you have not deleted it
      • It’s recommended to double check before you delete an orphaned disk because it is not recoverable
      • Creating a snapshot can be an option to backup orphaned disk before deleting
  • Orphaned App Service Plans
    • App Service Plan charges a cost although he does not host any Apps

 

Operational & misconfiguration perspective

  • Network Interfaces
    • Orphaned Network Interface has no cost, but it takes up space within the virtual network range
  • Route Tables
    • It’s important to delete orphaned Route Tables to prevent misconfiguration by associating a wrong Route Table to a subnet
  • Network Security Groups (NSGs)
    • It’s important to delete orphaned Network Security Groups (aka: NSG) to prevent misconfiguration by associating the wrong NSG to a subnet or network interface with unrelevant inbound/outbound rules

 

The Workbook

This workbook will centralize and help present orphaned resources and allow you to:

  • Save money
  • Prevent mistakes and misconfiguration
  • Simplify operational

All the information presented in this Workbook is based on Azure Resource Graph queries.

 

Types of resources the workbook covers:

  • Compute
    • App Service Plans
    • Availability Set
  • Storage
    • Disks
  • Database
    • SQL Elastic Pools
  • Networking
    • Public IPs
    • Network Interfaces
    • Network Security Groups
    • Route Tables
    • Load Balancers
    • Front Door WAF Policy
    • Traffic Manager Profiles
    • Application Gateways
    • Virtual Networks
    • Subnets
    • NAT Gateways
    • IP Groups
    • Private DNS zones
    • Private Endpoints
    • Virtual Network Gateways
  • Others
    • Resource Groups
    • API Connections
    • Certificates

 

Your Support

I would love your feedback:

  1. How many orphaned resources have you found?
  2. What type of resources?
  3. How much potential money has been saved?
  4. Additional resource types that you think may be covered by this workbook?
 

Overview

 

Orphaned-Resources-Workbook-v2-01.png

 

Orphaned Disks

 

Orphaned-Resources-Workbook-v2-02.png

 

Orphaned Public IPs (Filter by Subscription)

 

Orphaned-Resources-Workbook-v2-03.png

55 Comments
Co-Authors
Version history
Last update:
‎Mar 21 2024 07:26 AM
Updated by: