Fix: exclude Dev/Test subscriptions from Azure Hybrid Benefit reports #1855
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The Rate Optimization workbook's Azure Hybrid Benefit (AHB) reports incorrectly included Dev/Test subscriptions, even though Azure Hybrid Benefit doesn't apply to these resources. Dev/Test subscriptions come with Visual Studio licenses that already cover Windows operating system costs, making them ineligible for Azure Hybrid Benefit.
This issue could lead to:
Root Cause
Analysis of the AHB workbook queries revealed that 4 out of 48 subscription-related queries were missing the Dev/Test exclusion filter. Specifically, all 4 queries were for Virtual Machine Scale Sets (VMSS):
src/workbooks/optimization/AHB/AHB.workbook(VMSSAHBEnabled-RG and VMSSAHBDisabled-RG)src/workbooks/optimization/Compute/AHB.workbookThe remaining 44 queries already had the correct filter in place, using the pattern:
Solution
Added the Dev/Test subscription exclusion filter to all 4 affected VMSS queries. This aligns them with:
Microsoft licensing requirements: Azure Hybrid Benefit for Windows Server requires Software Assurance or subscription licenses through commercial licensing agreements, which Dev/Test subscriptions don't use.
Existing workbook patterns: 91.7% of queries (44/48) already excluded Dev/Test subscriptions correctly.
FinOps toolkit documentation: The toolkit's own workbook customization guide explicitly states: "It queries the ResourceContainers table and removes the ones that are Dev/Test because Azure Hybrid Benefit doesn't apply to Dev/Test resources."
Changes
src/workbooks/optimization/AHB/AHB.workbook: Added Dev/Test filter to 2 VMSS queriessrc/workbooks/optimization/Compute/AHB.workbook: Added Dev/Test filter to 2 VMSS queriesdocs-mslearn/toolkit/changelog.md: Documented the fixTesting
Impact
Dev/Test subscriptions are now automatically excluded from all Azure Hybrid Benefit reports. This provides accurate license tracking without requiring users to manually filter or toggle subscription types.
Fixes #1855
Original prompt
Fixes #1819
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.