Skip to content

Conversation

@flanakin
Copy link
Collaborator

Summary

  • Fixes incorrect SQL Managed Instance vCores count displaying astronomically large numbers (e.g., 44 × 10^42) in the AHB workbook pie chart
  • Changed vCores=tostring(sku.capacity) to vCores=toint(sku.capacity) in all SQL MI queries

Root Cause

The vCores field was being converted to a string using tostring(). When the pie chart visualization tried to sum these values, it incorrectly handled the string-to-number conversion, resulting in the bizarre display.

Test plan

  • Deploy the AHB workbook to an Azure environment with SQL Managed Instances
  • Navigate to Rate optimization > SQL > SQL Managed Instances
  • Verify the "SQL Managed Instances AHB Cores not enabled per AHB Priority" pie chart shows correct vCore counts

Closes #1877

🤖 Generated with Claude Code

Change vCores from tostring() to toint() so the pie chart visualization
correctly sums the numeric values instead of concatenating strings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 13, 2026 09:12
@flanakin flanakin added this to the v13 milestone Jan 13, 2026
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Review 👀 PR that is ready to be reviewed label Jan 13, 2026
@microsoft-github-policy-service microsoft-github-policy-service bot added Tool: Workbooks Azure Monitor workbooks Tool: Optimization workbook FinOps workbook for cost optimization labels Jan 13, 2026
@flanakin
Copy link
Collaborator Author

@microsoft-github-policy-service agree

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a critical bug in the Azure Hybrid Benefit (AHB) workbooks where SQL Managed Instance vCore counts were displaying astronomically large numbers (e.g., 44 × 10^42) in pie chart visualizations. The root cause was the vCores field being converted to string using tostring(), which caused the pie chart's summation logic to incorrectly handle string-to-number conversion.

Changes:

  • Changed all occurrences of vCores=tostring(sku.capacity) to vCores=toint(sku.capacity) in KQL queries
  • Applied the fix consistently across SQL databases, elastic pools, and managed instances queries
  • Fixed queries for both "AHB enabled" and "AHB disabled" states in both AHB workbook variants

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/workbooks/optimization/Compute/AHB.workbook Fixed vCore data type conversion from string to integer for SQL databases (2 instances), elastic pools (4 instances), and managed instances (4 instances) across all AHB-related queries
src/workbooks/optimization/AHB/AHB.workbook Fixed vCore data type conversion from string to integer for SQL databases (2 instances), elastic pools (4 instances), and managed instances (4 instances) across all AHB-related queries

Copy link
Collaborator

@RolandKrummenacher RolandKrummenacher left a comment

Choose a reason for hiding this comment

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

Tested. That does fix the issue. However, I don't know whether there are any side effects.

Copy link
Contributor

Copilot AI commented Jan 13, 2026

@RolandKrummenacher I've opened a new pull request, #1938, to work on those changes. Once the pull request is ready, I'll request review from you.

@RolandKrummenacher
Copy link
Collaborator

@copilot can you and add a change log entry without creating a new pr?

Copy link
Contributor

Copilot AI commented Jan 13, 2026

@RolandKrummenacher I've opened a new pull request, #1939, to work on those changes. Once the pull request is ready, I'll request review from you.

@flanakin flanakin merged commit 803bdad into dev Jan 13, 2026
2 of 3 checks passed
@flanakin flanakin deleted the fix/1877-sqlmi-vcores-count branch January 13, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Review 👀 PR that is ready to be reviewed Tool: Optimization workbook FinOps workbook for cost optimization Tool: Workbooks Azure Monitor workbooks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Workbook] Azure Hybrid benefit - Inconsistent count for SQL MI vCores

5 participants