# Orphaned Azure Disk and IP Finder

> Finds orphaned Azure resources in az CLI JSON: unattached managed disks, public IPs on no NIC, load balancer or NAT gateway, NICs attached to nothing, and old snapshots. Skips disks tagged keep and Site Recovery disks. Totals orphaned GiB. Offline and read-only.

Orphaned Azure Disk and IP Finder is a paid AI agent skill on Agensi by Abdelrhman Fikri, in DevOps & Cloud. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $8.99 (one-time purchase)
- Creator: [Abdelrhman Fikri](https://www.agensi.io/creators/abdelrhman-fikri)
- Category: [DevOps & Cloud](https://www.agensi.io/skills/devops-cloud)
- Version: 1.0.0
- Last updated: 2026-12-03
- Security: scan passed (2026-12-03); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/orphaned-azure-disk-and-ip-finder
- Tags: devops, database, code-review, azure, cost, cleanup, finops, managed-disks

## What it does

- Reads az disk list, az network public-ip list, az network nic list and az snapshot list JSON
- Flags unattached managed disks and public IPs that no NIC, load balancer or NAT gateway uses as orphans
- Flags network interfaces attached to no virtual machine or private endpoint
- Lists old snapshots, and snapshots whose source disk is not in the export, for review
- Skips disks with an active SAS, such as Site Recovery disks, and resources tagged keep
- Totals the GiB held by orphaned disks and exits 1 when orphans exist

## Who it's for

- **Cloud engineers and FinOps practitioners:** who want a clean-up list of idle Azure disks, IPs and network interfaces.
- **Platform teams:** who check before they delete anything.

## About this skill

Every Azure estate collects idle resources: a disk left behind when a VM was deleted, a public IP nobody uses, a network interface with nothing attached, snapshots from last year. They keep billing and they are hard to find by clicking. This skill gives your agent a deterministic, offline workflow: export the lists with the az CLI, run the bundled finder, and read a short report with names, sizes, SKUs and ages.

The finder is a single standard-library script. It does not call Azure and never deletes anything. It reads the JSON from az disk list, az network public-ip list, az network nic list and az snapshot list, either as separate files or mixed in one folder. A disk with state Unattached is an orphan unless it is newer than a threshold (then it is for review). A disk in state Reserved belongs to a deallocated VM and is for review. Disks with an active SAS, which is how Site Recovery and exports look, are never called orphans. Public IPs with no NIC, load balancer or NAT gateway are orphans, and an IP attached only to an orphaned NIC is listed for review. Snapshots are for review only: old ones, and ones whose source disk is missing from the export. Resources tagged keep, do-not-delete, donotdelete or retain are left out, and you can add your own tag key.

Synthetic example files with expected output are included so you can verify the behaviour in seconds. Pass the as-of date to get reproducible ages.

## Known limitations

- It only sees what is in the exports. A resource in another subscription or resource group may look orphaned or may be the source of a snapshot.
- Age comes from the creation time, not from the time a disk became unattached, so a disk detached yesterday can look old.
- It does not estimate cost; it reports sizes and SKUs only.
- Load balancers, NAT gateways and other resources are not inspected beyond the references on the IP; backend pools are not read.
- Reports and explains; it never deletes or changes anything. Check each item before you act.

## Technical details

The finder is a single standard-library Python script. It makes no network calls and never writes files. Give it files or directories; it reads .json.

Input: lists (or an object with a value list) from az disk list, az network public-ip list, az network nic list and az snapshot list. Resource kind comes from the type field or the field shapes. Fields may be at the top level or under properties.

Rules: a disk with diskState Unattached (or no managedBy and no state) is ORPHAN, or REVIEW when newer than --min-age-days (default 7). Reserved disks are REVIEW. ActiveSAS, ReadyToUpload and ActiveUpload disks are INFO. A public IP with a null ipConfiguration and no NAT gateway is ORPHAN. A NIC with no virtual machine and no private endpoint is ORPHAN. A public IP attached only to an orphan NIC is REVIEW. A snapshot older than --snapshot-age-days (default 90), or whose source disk is missing from a disk export, is REVIEW.

Other options: --as-of YYYY-MM-DD (default today), --keep-tag KEY (repeatable), --format json. Exit codes: 0 no orphans, 1 orphans found, 2 bad arguments.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Orphaned Azure Disk and IP Finder skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Does it need Azure access?

No. It reads JSON you export with the az CLI.

### Will it delete anything?

No. It is read-only; deleting is a separate decision for you.

### Why is a disk marked REVIEW and not ORPHAN?

It is either newer than the age threshold, or in state Reserved because its VM is deallocated.

### How do I protect an item?

Tag it keep, do-not-delete, donotdelete or retain, or pass your own tag key with the keep-tag option.

### What does exit code 1 mean?

One or more ORPHAN findings. Review items alone still exit 0.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
