
# Azure Nuke
[](https://github.com/sojay/azure-nuke/actions?query=workflow%3A%22Build+Cross-Platform+Binaries%22)
[](https://badge.fury.io/py/aznuke)
[](https://pypi.org/project/aznuke/)
[](https://opensource.org/licenses/MIT)
A powerful CLI tool for scanning and cleaning up Azure resources.
## Features
- **Comprehensive scanning** of Azure resources across subscriptions
- **Safe deletion** with confirmation prompts and dry-run mode
- **Flexible filtering** by resource type, region, and more
- **Exclusion system** to protect critical infrastructure
- **Beautiful ASCII art banners** for a better command-line experience
- **Color-coded output** for easy identification of actions and results
## Installation
### Homebrew (Recommended for macOS/Linux)
```bash
# Add the tap
brew tap sojay/tap
# Install Azure Nuke
brew install aznuke
```
### Binary Download
Download pre-built binaries for your platform from [GitHub Releases](https://github.com/sojay/azure-nuke/releases).
**Supported Platforms:**
- Linux (AMD64, ARM64)
- macOS (AMD64, ARM64)
- Windows (AMD64)
```bash
# Linux/macOS - make executable and move to PATH
chmod +x aznuke-*
sudo mv aznuke-* /usr/local/bin/aznuke
```
### Python Package
```bash
# Install from PyPI
pip install aznuke
# Or clone the repository and install in development mode
git clone https://github.com/sojay/azure-nuke.git
cd azure-nuke
pip install -e .
```
## Usage
Azure Nuke provides two main commands:
### Scan Command
The `scan` command identifies Azure resources according to specified criteria:
```bash
# Run a full scan
aznuke scan
# Scan a specific subscription and region
aznuke scan --profile production --region westus2
# Scan only Storage and VM resources
aznuke scan --checks storage,virtualmachines
# Export results as JSON
aznuke scan --output json > azure_report.json
# Show only high severity issues
aznuke scan --severity high
# Verbose output for debugging
aznuke scan -v
```
### Delete Command
The `delete` command removes Azure resources:
```bash
# Delete resources (with confirmation)
aznuke delete
# Delete specific resource types without confirmation
aznuke delete --checks storage,virtualmachines --yes
# Perform a dry run to see what would be deleted
aznuke delete --dry-run
```
## Options
### Global Options
- `--profile`: Azure subscription profile name
- `--region`: Azure region to target
- `--checks`: Comma-separated list of resource types
- `--config`: Path to exclusions configuration file
- `-v, --verbose`: Enable verbose output
### Scan-specific Options
- `--output`: Output format (text or json)
- `--severity`: Filter by severity level (low, medium, high)
### Delete-specific Options
- `--dry-run`: Preview resources that would be deleted without actually deleting
- `--protected-subscriptions`: List of subscription IDs that should not be modified
- `--yes, -y`: Skip confirmation prompt
## Configuration
Exclusions can be configured in `config/exclusions.yaml` to prevent certain resources from being included in scans or deletions. You can specify your own configuration file using the `--config` option.
### Exclusion Configuration Format
```yaml
# Exclude specific resource types
resource_types:
- Microsoft.KeyVault/vaults # Exclude all Key Vaults
- Microsoft.Storage/storageAccounts # Exclude all Storage Accounts
# Exclude resources with names matching these patterns
name_patterns:
- "^prod-.*$" # Exclude resources with names starting with "prod-"
- ".*-do-not-delete$" # Exclude with names ending with "-do-not-delete"
# Exclude specific resource IDs
resource_ids:
- "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/important-rg/providers/Microsoft.Storage/storageAccounts/criticalaccount"
# Exclude resources with specified tags
tags:
Environment: "Production"
DoNotDelete: "true"
```
## Examples
```bash
# Scan all resources in the development subscription
aznuke scan --profile development
# Output scan results as JSON
aznuke scan --output json > scan_results.json
# Delete all storage accounts in westus2 region
aznuke delete --checks microsoft.storage/storageaccounts --region westus2
# Dry run to see what would be deleted
aznuke delete --checks microsoft.compute/virtualmachines --dry-run
# Delete resources with force, skipping confirmation
aznuke delete --yes
# Use a custom exclusions config file
aznuke scan --config my-exclusions.yaml
```
## License
MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/sojay/azure-nuke",
"name": "aznuke",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "azure, cloud, cleanup, infrastructure, devops",
"author": "Samuel Okorie",
"author_email": "Samuel Okorie <thesamokorie@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/04/f5/b6a8ee888ade1b905317e8856dd84ef7f6f1c68785135868735c00bf46b1/aznuke-0.1.8.tar.gz",
"platform": null,
"description": "\n\n# Azure Nuke\n\n[](https://github.com/sojay/azure-nuke/actions?query=workflow%3A%22Build+Cross-Platform+Binaries%22)\n[](https://badge.fury.io/py/aznuke)\n[](https://pypi.org/project/aznuke/)\n[](https://opensource.org/licenses/MIT)\n\nA powerful CLI tool for scanning and cleaning up Azure resources.\n\n## Features\n\n- **Comprehensive scanning** of Azure resources across subscriptions\n- **Safe deletion** with confirmation prompts and dry-run mode\n- **Flexible filtering** by resource type, region, and more\n- **Exclusion system** to protect critical infrastructure\n- **Beautiful ASCII art banners** for a better command-line experience\n- **Color-coded output** for easy identification of actions and results\n\n## Installation\n\n### Homebrew (Recommended for macOS/Linux)\n\n```bash\n# Add the tap\nbrew tap sojay/tap\n\n# Install Azure Nuke\nbrew install aznuke\n```\n\n### Binary Download\n\nDownload pre-built binaries for your platform from [GitHub Releases](https://github.com/sojay/azure-nuke/releases).\n\n**Supported Platforms:**\n- Linux (AMD64, ARM64)\n- macOS (AMD64, ARM64) \n- Windows (AMD64)\n\n```bash\n# Linux/macOS - make executable and move to PATH\nchmod +x aznuke-*\nsudo mv aznuke-* /usr/local/bin/aznuke\n```\n\n### Python Package\n\n```bash\n# Install from PyPI\npip install aznuke\n\n# Or clone the repository and install in development mode\ngit clone https://github.com/sojay/azure-nuke.git\ncd azure-nuke\npip install -e .\n```\n\n## Usage\n\nAzure Nuke provides two main commands:\n\n### Scan Command\n\nThe `scan` command identifies Azure resources according to specified criteria:\n\n```bash\n# Run a full scan\naznuke scan\n\n# Scan a specific subscription and region\naznuke scan --profile production --region westus2\n\n# Scan only Storage and VM resources\naznuke scan --checks storage,virtualmachines\n\n# Export results as JSON\naznuke scan --output json > azure_report.json\n\n# Show only high severity issues\naznuke scan --severity high\n\n# Verbose output for debugging\naznuke scan -v\n```\n\n### Delete Command\n\nThe `delete` command removes Azure resources:\n\n```bash\n# Delete resources (with confirmation)\naznuke delete\n\n# Delete specific resource types without confirmation\naznuke delete --checks storage,virtualmachines --yes\n\n# Perform a dry run to see what would be deleted\naznuke delete --dry-run\n```\n\n## Options\n\n### Global Options\n\n- `--profile`: Azure subscription profile name\n- `--region`: Azure region to target\n- `--checks`: Comma-separated list of resource types\n- `--config`: Path to exclusions configuration file\n- `-v, --verbose`: Enable verbose output\n\n### Scan-specific Options\n\n- `--output`: Output format (text or json)\n- `--severity`: Filter by severity level (low, medium, high)\n\n### Delete-specific Options\n\n- `--dry-run`: Preview resources that would be deleted without actually deleting\n- `--protected-subscriptions`: List of subscription IDs that should not be modified\n- `--yes, -y`: Skip confirmation prompt\n\n## Configuration\n\nExclusions can be configured in `config/exclusions.yaml` to prevent certain resources from being included in scans or deletions. You can specify your own configuration file using the `--config` option.\n\n### Exclusion Configuration Format\n\n```yaml\n# Exclude specific resource types\nresource_types:\n - Microsoft.KeyVault/vaults # Exclude all Key Vaults\n - Microsoft.Storage/storageAccounts # Exclude all Storage Accounts\n\n# Exclude resources with names matching these patterns\nname_patterns:\n - \"^prod-.*$\" # Exclude resources with names starting with \"prod-\"\n - \".*-do-not-delete$\" # Exclude with names ending with \"-do-not-delete\"\n\n# Exclude specific resource IDs\nresource_ids:\n - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/important-rg/providers/Microsoft.Storage/storageAccounts/criticalaccount\"\n\n# Exclude resources with specified tags\ntags:\n Environment: \"Production\"\n DoNotDelete: \"true\"\n```\n\n## Examples\n\n```bash\n# Scan all resources in the development subscription\naznuke scan --profile development\n\n# Output scan results as JSON\naznuke scan --output json > scan_results.json\n\n# Delete all storage accounts in westus2 region\naznuke delete --checks microsoft.storage/storageaccounts --region westus2\n\n# Dry run to see what would be deleted\naznuke delete --checks microsoft.compute/virtualmachines --dry-run\n\n# Delete resources with force, skipping confirmation\naznuke delete --yes\n\n# Use a custom exclusions config file\naznuke scan --config my-exclusions.yaml\n```\n\n## License\n\nMIT \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Azure resource scanner and cleanup tool",
"version": "0.1.8",
"project_urls": {
"Documentation": "https://sojay.github.io/azure-nuke",
"Homepage": "https://github.com/sojay/azure-nuke",
"Issues": "https://github.com/sojay/azure-nuke/issues",
"Repository": "https://github.com/sojay/azure-nuke.git"
},
"split_keywords": [
"azure",
" cloud",
" cleanup",
" infrastructure",
" devops"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "bed4a787b5dd2f56e67f04bad45d8d3f6e8b6372033b4520686dfde15eef75d4",
"md5": "95db95b62ee3f7c31f1f8b8e96721858",
"sha256": "5566419ccda1b00dc7817149a52de4a2f772d409ca26bb2311d66c91f1ac387b"
},
"downloads": -1,
"filename": "aznuke-0.1.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "95db95b62ee3f7c31f1f8b8e96721858",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 30063,
"upload_time": "2025-07-17T00:22:01",
"upload_time_iso_8601": "2025-07-17T00:22:01.144299Z",
"url": "https://files.pythonhosted.org/packages/be/d4/a787b5dd2f56e67f04bad45d8d3f6e8b6372033b4520686dfde15eef75d4/aznuke-0.1.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "04f5b6a8ee888ade1b905317e8856dd84ef7f6f1c68785135868735c00bf46b1",
"md5": "9c0ddc5b2a7a87e0684cbfee439359eb",
"sha256": "b0730f5f8a7515dfca84da9d4d43a73f0dcb258856cae07366d30a3552ec81df"
},
"downloads": -1,
"filename": "aznuke-0.1.8.tar.gz",
"has_sig": false,
"md5_digest": "9c0ddc5b2a7a87e0684cbfee439359eb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 55783,
"upload_time": "2025-07-17T00:22:02",
"upload_time_iso_8601": "2025-07-17T00:22:02.486772Z",
"url": "https://files.pythonhosted.org/packages/04/f5/b6a8ee888ade1b905317e8856dd84ef7f6f1c68785135868735c00bf46b1/aznuke-0.1.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-17 00:22:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sojay",
"github_project": "azure-nuke",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "azure-cli",
"specs": []
},
{
"name": "azure-identity",
"specs": [
[
">=",
"1.10.0"
]
]
},
{
"name": "azure-mgmt-resource",
"specs": [
[
">=",
"22.0.0"
]
]
},
{
"name": "azure-mgmt-subscription",
"specs": [
[
">=",
"3.1.1"
]
]
},
{
"name": "azure-mgmt-compute",
"specs": [
[
">=",
"27.0.0"
]
]
},
{
"name": "azure-mgmt-network",
"specs": [
[
">=",
"22.0.0"
]
]
},
{
"name": "azure-mgmt-storage",
"specs": [
[
">=",
"20.0.0"
]
]
},
{
"name": "azure-mgmt-keyvault",
"specs": [
[
">=",
"10.0.0"
]
]
},
{
"name": "azure-mgmt-monitor",
"specs": [
[
">=",
"5.0.0"
]
]
},
{
"name": "azure-core",
"specs": [
[
">=",
"1.26.0"
]
]
},
{
"name": "msal",
"specs": [
[
">=",
"1.20.0"
]
]
},
{
"name": "msal-extensions",
"specs": [
[
">=",
"1.0.0"
]
]
},
{
"name": "pyyaml",
"specs": [
[
">=",
"6.0"
]
]
},
{
"name": "pytest",
"specs": [
[
">=",
"7.0.0"
]
]
},
{
"name": "pytest-cov",
"specs": [
[
">=",
"4.0.0"
]
]
},
{
"name": "pytest-mock",
"specs": [
[
">=",
"3.8.0"
]
]
},
{
"name": "black",
"specs": [
[
">=",
"22.3.0"
]
]
},
{
"name": "pylint",
"specs": [
[
">=",
"2.13.0"
]
]
},
{
"name": "flake8",
"specs": [
[
">=",
"4.0.1"
]
]
},
{
"name": "colorama",
"specs": [
[
"==",
"0.4.6"
]
]
},
{
"name": "pyfiglet",
"specs": [
[
"==",
"0.8.post1"
]
]
},
{
"name": "tqdm",
"specs": [
[
"==",
"4.66.1"
]
]
},
{
"name": "setuptools",
"specs": [
[
">=",
"65.0.0"
]
]
},
{
"name": "wheel",
"specs": [
[
">=",
"0.37.0"
]
]
}
],
"lcname": "aznuke"
}