-
Notifications
You must be signed in to change notification settings - Fork 189
Fix SQL MI vCores showing incorrect count in AHB workbook #1936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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>
|
@microsoft-github-policy-service agree |
There was a problem hiding this 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)tovCores=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 |
RolandKrummenacher
left a comment
There was a problem hiding this 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.
|
@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. |
|
@copilot can you and add a change log entry without creating a new pr? |
|
@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. |
Summary
vCores=tostring(sku.capacity)tovCores=toint(sku.capacity)in all SQL MI queriesRoot Cause
The
vCoresfield was being converted to a string usingtostring(). 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
Closes #1877
🤖 Generated with Claude Code