terraform-azurerm-set-diff-analyzer
- Use it when:
- terraform plan shows every element of an Application Gateway, Load Balancer, NSG or similar as changed after you edited one.
- It does:
- Exports the plan as JSON and runs a bundled script that tells reordered Set elements apart from added, removed or modified ones.
- You get:
- Each change sorted as order-only, an actual Set change or a resource replacement, as Markdown, JSON or a one-line summary.
- Needs:
- Terraform and Python 3.8 or later; the script uses only the standard library and covers only azurerm_* resources.
- Why:
- Terraform compares Set-type attributes by position, so adding or removing one element marks them all as changed.
- In CI:
- Exit codes can stop a pipeline on real changes or replacements, with GitHub Actions and Azure Pipelines examples.
Needs Python 3.8+ and Terraform; only azurerm_* resources are supported.
TL;DR
Terraform's Set-type attributes are compared by position rather than by key, so adding or removing one backend pool or security rule makes every element look changed. AzureRM resources such as Application Gateway, Load Balancer, Firewall, Front Door and NSG use many of them, which makes their plans hard to review. The skill has the agent save the plan with terraform plan -out, export it with terraform show -json, and run scripts/analyze_plan.py on the JSON. The script uses only Python's standard library and sorts changes into order-only diffs that are safe to ignore, actual Set changes to review, and resource replacements to check for downtime. It writes Markdown for PR comments, JSON for programs or a one-line summary for CI logs, can include or exclude resource types, and with --exit-code returns 0 to 3 so a pipeline can gate on the result. Values known only after apply, or masked as sensitive, may compare incompletely.
Summarizes the skill at 797337f.
npx skills add https://github.com/github/awesome-copilot --skill terraform-azurerm-set-diff-analyzer skills.sh pageSource on GitHubAll skills from github/awesome-copilot
- Total Downloads
- 8,900 on skills.sh, Nov 9, 2026
- Repo stars
- 40,943 github/awesome-copilot
- First seen
- Feb 2, 2026 on skills.sh
Weekly values
| Week to | Installs |
|---|---|
| Sep 21 | 10 |
| Sep 28 | 12 |
| Oct 5 | 15 |
| Oct 12 | 7 |
| Oct 19 | 8 |
| Oct 26 | 2 |
| Nov 2 | 4 |
| Nov 9 | 2 |
| Category |
Deploy, provision, observe and debug cloud apps. Everything for building software: planning, coding, debugging, design, frameworks, cloud, agents and skills. |
|---|---|
| Type |
Operates a CLI, API, app or bundled script to get something done. |
| Effect |
Its own steps create or change files, git state or local tools. |
| Needs |
A specific command-line tool or desktop app must be installed, such as gh, agent-browser, LibreOffice, Obsidian or a vendor CLI. |
| Publisher |
A verified publisher on skills.sh, or the company or maintainer behind the product the skill operates. |
| Topics | |
| Stack |
SKILL.md
From github/awesome-copilot at 797337f. Checked daily, last changed Nov 6, 2026.
Frontmatter
name: terraform-azurerm-set-diff-analyzer
description: Analyze Terraform plan JSON output for AzureRM Provider to distinguish between false-positive diffs (order-only changes in Set-type attributes) and actual resource changes. Use when reviewing terraform plan output for Azure resources like Application Gateway, Load Balancer, Firewall, Front Door, NSG, and other resources with Set-type attributes that cause spurious diffs due to internal ordering changes.
license: MITTerraform AzureRM Set Diff Analyzer
A skill to identify "false-positive diffs" in Terraform plans caused by AzureRM Provider's Set-type attributes and distinguish them from actual changes.
When to Use
terraform planshows many changes, but you only added/removed a single element- Application Gateway, Load Balancer, NSG, etc. show "all elements changed"
- You want to automatically filter false-positive diffs in CI/CD
Background
Terraform's Set type compares by position rather than by key, so when adding or removing elements, all elements appear as "changed". This is a general Terraform issue, but it's particularly noticeable with AzureRM resources that heavily use Set-type attributes like Application Gateway, Load Balancer, and NSG.
These "false-positive diffs" don't actually affect the resources, but they make reviewing terraform plan output difficult.
Prerequisites
- Python 3.8+
If Python is unavailable, install via your package manager (e.g., apt install python3, brew install python3) or from python.org.
Basic Usage
# 1. Generate plan JSON output
terraform plan -out=plan.tfplan
terraform show -json plan.tfplan > plan.json
# 2. Analyze
python scripts/analyze_plan.py plan.json
Troubleshooting
python: command not found: Usepython3instead, or install PythonModuleNotFoundError: Script uses only standard library; ensure Python 3.8+
Detailed Documentation
- scripts/README.md - All options, output formats, exit codes, CI/CD examples
- references/azurerm_set_attributes.md - Supported resources and attributes