Skip to content

feat: add idle Azure VPN Gateway detection - #23

Merged
raphgm merged 1 commit into
raphgm:mainfrom
jhayoncloud:feat/idle-vpn-gateways
Sep 22, 2026
Merged

raphgm merged 1 commit into
raphgm:mainfrom
jhayoncloud:feat/idle-vpn-gateways

Conversation

@jhayoncloud

Copy link
Copy Markdown
Contributor

Summary

Adds support for detecting idle Azure VPN Gateways based on Azure Monitor bandwidth metrics.

Changes

  • Added a new azure.idle_vpn_gateway source.
  • Lists Azure VPN Gateways in the configured resource group.
  • Queries the AverageBandwidth metric using hourly intervals over the configured lookback period.
  • Calculates the average bandwidth across the lookback window.
  • Fetches the live hourly VPN Gateway price from the Azure Retail Prices API using the gateway SKU and region.
  • Added a SQL policy that identifies gateways with zero average bandwidth and calculates estimated monthly cost using 730 hours.
  • Registered the new Azure source in the pipeline runner.
  • Added a real Azure test pipeline configuration for the VPN Gateway detection flow.

Validation

  • Tested against a real Azure VPN Gateway.
  • Verified the Azure Monitor AverageBandwidth metric.
  • Verified live Azure Retail Pricing lookup.
  • Verified the source → DuckDB → SQL policy pipeline end-to-end.
  • Full existing test suite passes: 50/50 tests.

Closes #12

@raphgm raphgm left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: pulled the branch, ran all 50 existing tests locally, all pass (matches your claim). Independently confirmed the live pricing filter against the Retail Prices API for a real SKU (VpnGw1, eastus -> $0.19/hr, correct). Good detail on the az.cmd/az cross-platform handling for Windows — most existing checks in this repo don't bother with that. Closes #12 cleanly. Thanks for following up on the questions in the issue thread first before building this.

@jhayoncloud

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and independently validating the implementation. I appreciate the feedback and the opportunity to contribute to the project!

@raphgm
raphgm merged commit b36e5ec into raphgm:main Sep 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add idle Azure VPN Gateway check

2 participants