Add parameters for noisy recommendations and rename query files#2011
Add parameters for noisy recommendations and rename query files#2011flanakin wants to merge 1 commit intofeatures/hubs-recsfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the FinOps hubs recommendations feature by adding granular control over potentially noisy recommendation types, standardizing naming conventions, and improving the deployment experience through the Azure portal UI.
Changes:
- Added
enableAHBRecommendationsandenableSpotRecommendationsparameters to allow users to opt-in to potentially noisy recommendations about Azure Hybrid Benefit and Spot VMs - Renamed recommendation query files from
HubsRecommendations-*toRecommendations-Microsoft-*pattern and updated metadata to use PascalCase (ResourceGraph,Tenant) instead of lowercase - Added a new "Recommendations" tab to the Azure portal deployment UI (createUiDefinition.json) with clear descriptions of included and optional recommendations
- Changed
enableRecommendationsdefault tofalseto reflect preview status - Improved code organization by using conditional query file loading with the
union()pattern
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/templates/finops-hub/main.bicep | Added three new parameters for recommendations control (enableRecommendations, enableAHBRecommendations, enableSpotRecommendations) and passed them to hub module |
| src/templates/finops-hub/modules/hub.bicep | Added recommendation parameters, changed enableRecommendations default to false, removed analytics dependency requirement from recommendations condition, and passed new parameters to recommendations module |
| src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/app.bicep | Implemented conditional query loading using union pattern, removed unused storage account resource, renamed dataset to dataset_resourceGraph (consistent casing), added case-insensitive switch logic |
| src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/*.json | Renamed all 10 query files to follow Recommendations-Microsoft-* pattern, updated metadata to use PascalCase (ResourceGraph, Tenant), changed source from "Azure Resource Graph" to "FinOps hubs" (except AdvisorCost), updated type field to match new naming |
| src/templates/finops-hub/createUiDefinition.json | Added new recommendations tab with clear UI explaining included vs optional recommendations, permissions requirements, and parameter mappings |
| module recommendations 'Microsoft.FinOpsHubs/Recommendations/app.bicep' = if (enableRecommendations) { | ||
| name: 'Microsoft.FinOpsHubs.Recommendations' | ||
| dependsOn: [ | ||
| core | ||
| analytics | ||
| ] |
There was a problem hiding this comment.
The recommendations module has a dependency on the analytics module, but the analytics module is only deployed when useFabric or useAzureDataExplorer is true. This creates a potential deployment failure if enableRecommendations is true but both useFabric and useAzureDataExplorer are false. The dependency on analytics should be conditional or removed if recommendations don't require analytics to function.
| "queryEngine": "ResourceGraph", | ||
| "scope": "Tenant", | ||
| "source": "FinOps hubs", | ||
| "type": "Microsoft-BackendlessAppGateways", |
There was a problem hiding this comment.
Why are we prefixing the type as being "Microsoft-*"? What ties these ARG queries to Microsoft? Is it the author? Should we add an "author" property instead?
🛠️ Description
Add
enableAHBRecommendationsandenableSpotRecommendationsparameters to control noisy recommendation types independently. Also renames query files to followRecommendations-Microsoft-*naming convention, adds a recommendations tab to createUiDefinition.json for the Azure portal deployment experience, and switchesenableRecommendationsto default off (preview).Fixes # N/A
📋 Checklist
🔬 How did you test this change?
🙋♀️ Do any of the following that apply?
📑 Did you update
docs/changelog.md?📖 Did you update documentation?