FinOps Server Inventory: decouple from sys.dm_os_sys_info; surface hardware gap (#1535) - #1592
Merged
Merged
Conversation
…are gap (#1535) Follow-up to #1589 (which fixed the connectivity probe but explicitly left the FinOps inventory display queries untouched). Split GetServerPropertiesLiveAsync in Lite and the deprecated Full Dashboard into a permission-free InventoryQueryText plus a best-effort HardwareQueryText read of sys.dm_os_sys_info. On Azure SQL DB that DMV needs VIEW DATABASE STATE; without it the old combined query threw and the FinOps Server Inventory grid lost the server's entire row (edition, version, storage - everything). Now edition/version/storage always render, and a non-alarming amber "Hardware Note" column shows why CPU/memory/socket facts are missing when the DMV read is denied. Also makes the Dashboard inventory storage Azure-safe: an engine-edition branch reads sys.database_files on Azure SQL DB (mirroring Lite) instead of hard-coding the Azure-absent sys.master_files, so the inventory query is Azure-safe end to end. - Lite/Dashboard: two-step read with the inventory command+reader scoped closed before the hardware read opens (connections have no MARS). New HardwareUnavailableReason on both models, bound to an amber note column beside the hardware fields in both FinOps grids; Dashboard MCP get_server_properties also returns hardware_unavailable_reason. - Regression-guard tests (Lite.Tests + Dashboard.Tests): InventoryQueryText carries no dm_os_sys_info and still carries SERVERPROPERTY('EngineEdition'); HardwareQueryText carries sys.dm_os_sys_info. - README: document that VIEW DATABASE STATE enables the sys.dm_os_* hardware inventory on Azure SQL DB (edition/version/storage still show without it). - CHANGELOG [Unreleased] > Fixed (#1592). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ventory-detection # Conflicts: # CHANGELOG.md
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Follow-up to #1589 (which fixed the connectivity probe but explicitly left the FinOps inventory display queries coupled to
sys.dm_os_sys_info). On Azure SQL DB that DMV needsVIEW DATABASE STATE; a monitoring login without it made the wholeGetServerPropertiesLiveAsyncquery throw, so the FinOps Server Inventory grid dropped the server's entire row (edition, version, storage — everything) and only wrote anAppLogger.Error.Fix (both Lite and the deprecated Full Dashboard)
GetServerPropertiesLiveAsyncis split into two pinnedconstqueries:InventoryQueryText— every permission-free fact (edition CASE,SERVERPROPERTYscalars, engine-edition-aware dynamic-SQL storage), hardware columns replaced by typed NULLs, noFROM sys.dm_os_sys_info. Succeeds for any connected login.HardwareQueryText—SELECT cpu_count, physical_memory_kb/1024, sqlserver_start_time, socket_count, cores_per_socket FROM sys.dm_os_sys_info, in its own try/catch; overwrites the hardware fields on success, setsHardwareUnavailableReasonon failure. The row still renders edition/version/storage.sys.master_files(absent on Azure SQL DB) — it now uses the sameEngineEdition = 5 ? sys.database_files : sys.master_filesbranch Lite already had, so the Dashboard query is Azure-safe end to end (identical work, both apps).Visibility
get_server_propertiesreturnshardware_unavailable_reason.VIEW DATABASE STATEis what enables thesys.dm_os_*hardware inventory on Azure SQL DB, and that edition/version/storage degrade gracefully without it.Tests / verification
FinOpsInventoryQueryTestsregression guard in each app pins the split (inventory carries nodm_os_sys_info+ still carriesSERVERPROPERTY('EngineEdition')+sys.database_files; hardware carriessys.dm_os_sys_info).Advances the FinOps follow-up tracked in #1535.
🤖 Generated with Claude Code