-
Notifications
You must be signed in to change notification settings - Fork 242
feat(hubs): add Azure Resource Manager ingestion #2277
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
Draft
Brett Wilson (MSBrett)
wants to merge
21
commits into
dev
Choose a base branch
from
features/finops-hubs-arm-app
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e230be1
feat(hubs): add Azure Resource Manager ingestion
MSBrett 3f94f79
Merge remote-tracking branch 'origin/dev' into features/finops-hubs-aβ¦
MSBrett c5f116e
feat(dashboard): add AI and emerging workloads view
MSBrett 8ddd21d
feat(hubs): collect availability zone and SKU restriction supply data
MSBrett e5ed70f
feat(dashboard): add the FinOps hub capacity dashboard canvas
MSBrett c05fc7c
chore: ignore local knowledge-graph tool output
MSBrett 50d51be
Merge branch 'features/psychic-fiesta' into features/finops-hubs-arm-app
MSBrett bdfeeac
feat(dashboard): add navigable Compute capacity details
MSBrett e74b6ee
fix(hubs): secure ARM paging and preserve scope identity
MSBrett 3746816
feat(hubs): expand quota ingestion
MSBrett d50b2b2
fix(hubs): complete ARM failure handling
MSBrett ae6d96d
fix(hubs): harden ARM query orchestration
MSBrett fba96ff
Revert "fix(hubs): harden ARM query orchestration"
MSBrett ffb9615
fix(hubs): restore ingestion and quota contracts
MSBrett 1e9c36a
chore: ignore local knowledge-graph tool artifacts
MSBrett de65482
feat(finops-hub): harden ingestion and expand dashboard
MSBrett 6205598
Merge remote-tracking branch 'origin/dev' into features/finops-hubs-aβ¦
MSBrett 246ae4b
fix(dashboard): remove fabricated MACC query
MSBrett dbb13f9
chore(hubs): update dashboard extension, quota catalog queries, and gβ¦
MSBrett aa21567
fix(hubs): remediate PR review findings for ARM ingestion
MSBrett a7d697c
feat(dashboard): add Azure AI capacity matrix view
MSBrett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
376 changes: 359 additions & 17 deletions
376
src/powershell/Tests/Unit/HubsIngestionQueries.Tests.ps1
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // | ||
| // NAME: App Service quota usage | ||
| // DESCRIPTION: Rehydrates the latest App Service quota usage records for each subscription and region. | ||
| // CATEGORY: Governance | ||
| // FEATURE: Quota | ||
| // REGION: All | ||
| // TECH: KQL | ||
| // | ||
| // RESOURCE TYPES: Microsoft.Web/locations/usages | ||
| // | ||
| // SOURCE: Quota() | ||
| // | ||
|
|
||
| Quota() | ||
| | where x_SourceType =~ 'AppServiceUsage' | ||
| | summarize arg_max(x_IngestionTime, *) by ResourceId | ||
| | project | ||
| ProviderName, | ||
| ResourceId, | ||
| ResourceName, | ||
| ResourceType, | ||
| SubAccountId, | ||
| displayName, | ||
| location, | ||
| currentValue, | ||
| limit, | ||
| unit, | ||
| x_QuotaDetails, | ||
| x_SourceType, | ||
| x_SourceVersion, | ||
| x_IngestionTime | ||
| | order by SubAccountId asc, location asc, ResourceName asc |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // | ||
| // NAME: Capacity reservations | ||
| // DESCRIPTION: Rehydrates the latest capacity reservation group inventory for each subscription. | ||
| // CATEGORY: Governance | ||
| // FEATURE: Quota | ||
| // REGION: All | ||
| // TECH: KQL | ||
| // | ||
| // RESOURCE TYPES: Microsoft.Compute/capacityReservationGroups | ||
| // | ||
| // SOURCE: Quota() | ||
| // | ||
| // NOTES: | ||
| // - Capacity reservation groups are inventory observations, so usage, limit, and unit may be empty. | ||
| // | ||
|
|
||
| Quota() | ||
| | where x_SourceType =~ 'CapacityReservation' | ||
| | summarize arg_max(x_IngestionTime, *) by ResourceId | ||
| | project | ||
| ProviderName, | ||
| ResourceId, | ||
| ResourceName, | ||
| ResourceType, | ||
| SubAccountId, | ||
| displayName, | ||
| location, | ||
| currentValue, | ||
| limit, | ||
| unit, | ||
| x_QuotaDetails, | ||
| x_SourceType, | ||
| x_SourceVersion, | ||
| x_IngestionTime | ||
| | order by SubAccountId asc, location asc, ResourceName asc |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // | ||
| // NAME: Azure AI services quota usage | ||
| // DESCRIPTION: Rehydrates the latest Azure AI services quota usage records for each subscription and region. | ||
| // CATEGORY: Governance | ||
| // FEATURE: Quota | ||
| // REGION: All | ||
| // TECH: KQL | ||
| // | ||
| // RESOURCE TYPES: Microsoft.CognitiveServices/locations/usages | ||
| // | ||
| // SOURCE: Quota() | ||
| // | ||
|
|
||
| Quota() | ||
| | where x_SourceType =~ 'CognitiveServicesUsage' | ||
| | summarize arg_max(x_IngestionTime, *) by ResourceId | ||
| | project | ||
| ProviderName, | ||
| ResourceId, | ||
| ResourceName, | ||
| ResourceType, | ||
| SubAccountId, | ||
| displayName, | ||
| location, | ||
| currentValue, | ||
| limit, | ||
| unit, | ||
| x_QuotaDetails, | ||
| x_SourceType, | ||
| x_SourceVersion, | ||
| x_IngestionTime | ||
| | order by SubAccountId asc, location asc, ResourceName asc |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // | ||
| // NAME: Compute quota usage | ||
| // DESCRIPTION: Rehydrates the latest compute quota usage records for each subscription and region. | ||
| // CATEGORY: Governance | ||
| // FEATURE: Quota | ||
| // REGION: All | ||
| // TECH: KQL | ||
| // | ||
| // RESOURCE TYPES: Microsoft.Compute/locations/usages | ||
| // | ||
| // SOURCE: Quota() | ||
| // | ||
|
|
||
| Quota() | ||
| | where x_SourceType =~ 'ComputeUsage' | ||
| | summarize arg_max(x_IngestionTime, *) by ResourceId | ||
| | project | ||
| ProviderName, | ||
| ResourceId, | ||
| ResourceName, | ||
| ResourceType, | ||
| SubAccountId, | ||
| displayName, | ||
| location, | ||
| currentValue, | ||
| limit, | ||
| unit, | ||
| x_QuotaDetails, | ||
| x_SourceType, | ||
| x_SourceVersion, | ||
| x_IngestionTime | ||
| | order by SubAccountId asc, location asc, ResourceName asc |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // | ||
| // NAME: Current quota usage | ||
| // DESCRIPTION: Shows the latest quota and capacity observations across subscriptions and regions. | ||
| // CATEGORY: Governance | ||
| // FEATURE: Quota | ||
| // REGION: All | ||
| // TECH: KQL | ||
| // | ||
| // SOURCE: Quota() | ||
| // | ||
|
|
||
| Quota() | ||
| | summarize arg_max(x_IngestionTime, *) by ResourceId | ||
| | project | ||
| ProviderName, | ||
| ResourceId, | ||
| ResourceName, | ||
| ResourceType, | ||
| SubAccountId, | ||
| displayName, | ||
| location, | ||
| currentValue, | ||
| limit, | ||
| unit, | ||
| x_SourceType, | ||
| x_SourceVersion, | ||
| x_IngestionTime | ||
| | order by SubAccountId asc, location asc, ResourceType asc, ResourceName asc |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // | ||
| // NAME: Quota headroom | ||
| // DESCRIPTION: Calculates remaining headroom and usage percentage for quota records with nonnegative limits. | ||
| // CATEGORY: Governance | ||
| // FEATURE: Quota | ||
| // REGION: All | ||
| // TECH: KQL | ||
| // | ||
| // SOURCE: Quota() | ||
| // | ||
|
|
||
| Quota() | ||
| | summarize arg_max(x_IngestionTime, *) by ResourceId | ||
| | extend | ||
| Headroom = iff(limit >= 0, limit - currentValue, real(null)), | ||
| PercentUsed = iff(limit > 0, round(100.0 * currentValue / limit, 1), real(null)) | ||
| | project | ||
| ProviderName, | ||
| ResourceId, | ||
| ResourceName, | ||
| ResourceType, | ||
| SubAccountId, | ||
| displayName, | ||
| location, | ||
| currentValue, | ||
| limit, | ||
| Headroom, | ||
| PercentUsed, | ||
| unit, | ||
| x_SourceType, | ||
| x_IngestionTime | ||
| | order by PercentUsed desc nulls last |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // | ||
| // NAME: Premium SSD v2 disks | ||
| // DESCRIPTION: Rehydrates the latest Premium SSD v2 disk inventory for each subscription. | ||
| // CATEGORY: Governance | ||
| // FEATURE: Quota | ||
| // REGION: All | ||
| // TECH: KQL | ||
| // | ||
| // RESOURCE TYPES: Microsoft.Compute/disks | ||
| // | ||
| // SOURCE: Quota() | ||
| // | ||
| // NOTES: | ||
| // - Premium SSD v2 disks are inventory observations. currentValue contains disk size in GiB, and limit may be empty. | ||
| // | ||
|
|
||
| Quota() | ||
| | where x_SourceType =~ 'PremiumSSDv2Disk' | ||
| | summarize arg_max(x_IngestionTime, *) by ResourceId | ||
| | project | ||
| ProviderName, | ||
| ResourceId, | ||
| ResourceName, | ||
| ResourceType, | ||
| SubAccountId, | ||
| displayName, | ||
| location, | ||
| currentValue, | ||
| limit, | ||
| unit, | ||
| x_QuotaDetails, | ||
| x_SourceType, | ||
| x_SourceVersion, | ||
| x_IngestionTime | ||
| | order by SubAccountId asc, location asc, ResourceName asc |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // | ||
| // NAME: SQL subscription quota usage | ||
| // DESCRIPTION: Rehydrates the latest Azure SQL quota usage records for each subscription and region. | ||
| // CATEGORY: Governance | ||
| // FEATURE: Quota | ||
| // REGION: All | ||
| // TECH: KQL | ||
| // | ||
| // RESOURCE TYPES: Microsoft.Sql/locations/usages | ||
| // | ||
| // SOURCE: Quota() | ||
| // | ||
|
|
||
| Quota() | ||
| | where x_SourceType =~ 'SqlSubscriptionUsage' | ||
| | summarize arg_max(x_IngestionTime, *) by ResourceId | ||
| | project | ||
| ProviderName, | ||
| ResourceId, | ||
| ResourceName, | ||
| ResourceType, | ||
| SubAccountId, | ||
| displayName, | ||
| location, | ||
| currentValue, | ||
| limit, | ||
| unit, | ||
| x_QuotaDetails, | ||
| x_SourceType, | ||
| x_SourceVersion, | ||
| x_IngestionTime | ||
| | order by SubAccountId asc, location asc, ResourceName asc |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // | ||
| // NAME: Storage quota usage | ||
| // DESCRIPTION: Rehydrates the latest Storage quota usage records for each subscription and region. | ||
| // CATEGORY: Governance | ||
| // FEATURE: Quota | ||
| // REGION: All | ||
| // TECH: KQL | ||
| // | ||
| // RESOURCE TYPES: Microsoft.Storage/locations/usages | ||
| // | ||
| // SOURCE: Quota() | ||
| // | ||
|
|
||
| Quota() | ||
| | where x_SourceType =~ 'StorageUsage' | ||
| | summarize arg_max(x_IngestionTime, *) by ResourceId | ||
| | project | ||
| ProviderName, | ||
| ResourceId, | ||
| ResourceName, | ||
| ResourceType, | ||
| SubAccountId, | ||
| displayName, | ||
| location, | ||
| currentValue, | ||
| limit, | ||
| unit, | ||
| x_QuotaDetails, | ||
| x_SourceType, | ||
| x_SourceVersion, | ||
| x_IngestionTime | ||
| | order by SubAccountId asc, location asc, ResourceName asc |
44 changes: 44 additions & 0 deletions
44
src/queries/catalog/savings-plan-recommendation-breakdown.kql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // | ||
| // NAME: Savings plan recommendation breakdown | ||
| // DESCRIPTION: Summarizes Savings Plan recommendations for all supported benefit types and terms. | ||
| // CATEGORY: Optimization | ||
| // FEATURE: Recommendations | ||
| // REGION: All | ||
| // TECH: KQL | ||
| // | ||
| // RESOURCE TYPES: Microsoft.CostManagement/benefitRecommendations | ||
| // | ||
| // SOURCE: Recommendations() | ||
| // | ||
| // NOTES: | ||
| // - Savings Plan recommendations include both compute and database benefits. | ||
| // - Costs and savings use the billing currency returned by Cost Management. | ||
| // - Savings rates are rounded to one decimal place for readability. | ||
| // | ||
|
|
||
| Recommendations() | ||
| | where x_SourceProvider =~ "Microsoft" and x_SourceType =~ "SavingsPlan" | ||
| | extend | ||
| BenefitType = replace_regex(tostring(x_RecommendationDetails.x_ArmSkuName), @"_Savings_Plan$", ""), | ||
| ArmSkuName = tostring(x_RecommendationDetails.x_ArmSkuName), | ||
| Term = tostring(x_RecommendationDetails.x_Term), | ||
| LookBackPeriod = tostring(x_RecommendationDetails.x_LookBackPeriod), | ||
| Scope = tostring(x_RecommendationDetails.x_Scope), | ||
| CurrencyCode = tostring(x_RecommendationDetails.x_CurrencyCode) | ||
| | summarize arg_max(x_RecommendationDate, *) by BenefitType, ArmSkuName, Term, LookBackPeriod, Scope | ||
| | project | ||
| BenefitType, | ||
| ArmSkuName, | ||
| Term, | ||
| LookBackPeriod, | ||
| Scope, | ||
| CurrencyCode, | ||
|
MSBrett marked this conversation as resolved.
Outdated
|
||
| CostWithoutBenefit = x_EffectiveCostBefore, | ||
| CostWithBenefit = x_EffectiveCostAfter, | ||
| EstimatedSavings = x_EffectiveCostSavings, | ||
| SavingsRate = round(100.0 * x_EffectiveCostSavings / x_EffectiveCostBefore, 1), | ||
| RecommendationDate = x_RecommendationDate, | ||
| RecommendationId = x_RecommendationId | ||
| | order by EstimatedSavings desc | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.