Skip to content

[Hubs] Recommendations app#2077

Open
flanakin wants to merge 14 commits intodevfrom
flanakin/recs
Open

[Hubs] Recommendations app#2077
flanakin wants to merge 14 commits intodevfrom
flanakin/recs

Conversation

@flanakin
Copy link
Copy Markdown
Collaborator

Summary

  • Add recommendations support to FinOps hubs, including ARG-based recommendations ingestion, a dedicated Recommendations app module, 15+ custom recommendation queries, and supporting documentation
  • Add parameters to control noisy recommendations and force lowercase on common filters/group bys
  • Add recommendations feature documentation and best practices content

Replaces #2065 (abandoning the features/hubs-recs branch).

Fixes #2011, #2010, #2003

Test plan

  • Lint tests
  • Unit tests
  • Manual deployment and verification

🤖 Generated with Claude Code

flanakin and others added 12 commits February 13, 2026 01:57
- Add Recommendations app with ARM linked service and Resource Graph dataset
- Add queries_ExecuteETL and queries_ETL_ingestion pipelines
- Add 10 ARG query files for cost optimization recommendations:
  - Azure Advisor cost recommendations
  - Backendless Application Gateways and Load Balancers
  - Empty SQL Elastic Pools
  - Non-Spot AKS Clusters
  - SQL VMs and Windows VMs without Azure Hybrid Benefit
  - Stopped VMs (not deallocated)
  - Unattached Disks and Public IPs
- Add recommendations_1.0.json schema file
- Add enableRecommendations parameter to hub.bicep
- Update documentation for HubsRecommendations data source

Co-Authored-By: Helder Pinto <hepint@microsoft.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: copilot-pull-request-reviewer <copilot-pull-request-reviewer@users.noreply.github.com>
Co-authored-by: helderpinto <helderpinto@users.noreply.github.com>
…hubs-recs

# Conflicts:
#	docs-mslearn/toolkit/changelog.md
#	docs-mslearn/toolkit/hubs/template.md
Co-authored-by: RolandKrummenacher <RolandKrummenacher@users.noreply.github.com>
Co-authored-by: copilot-pull-request-reviewer <copilot-pull-request-reviewer@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: RolandKrummenacher <RolandKrummenacher@users.noreply.github.com>
Co-authored-by: Roland Krummenacher <roland.krummenacher@outlook.com>
Co-authored-by: Roland Krummenacher <roland.krummenacher@alescent.com>
Co-authored-by: copilot-pull-request-reviewer <copilot-pull-request-reviewer@users.noreply.github.com>
Copy link
Copy Markdown
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

Adds a new Recommendations capability to FinOps hubs by introducing an ARG-backed ingestion path (query orchestration + ARG query engine), a dedicated Recommendations app that ships built-in/custom recommendation queries + schema, and supporting docs/scripts/version updates to align the repo with the v14 dev cycle.

Changes:

  • Add FinOps hubs recommendations support (Recommendations app module + ARG engine app + ingestion query orchestration + transforms).
  • Add a build step to generate recommendation query file wiring and update RBAC/pipeline dispatch support.
  • Update docs, scripts, tests, and versioning for v14 (including a new open-data workflow/script).

Reviewed changes

Copilot reviewed 187 out of 189 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/workbooks/.scaffold/ftkver.txt Bumps scaffolded workbook version to v14 dev.
src/templates/finops-workbooks/ftkver.txt Bumps workbooks template version to v14 dev.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/schemas/recommendations_1.0.json Adds schema/translator for Recommendations ingestion.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-VMsWithoutAHB.json Adds custom recommendation query (AHB).
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-UnprovisionedExpressRouteCircuits.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-UnmanagedDisks.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-UnattachedPublicIPs.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-UnattachedNICs.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-UnattachedDisks.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-UnassociatedDDoSPlans.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-StoppedVMs.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-SQLVMsWithoutAHB.json Adds custom recommendation query (AHB).
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-PremiumSnapshots.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-OrphanedNATGateways.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-NonSpotAKSClusters.json Adds custom recommendation query (Spot).
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-LegacyStorageAccounts.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-IdleVNetGateways.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-EmptySQLElasticPools.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-EmptyNSGs.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-EmptyAppServicePlans.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-ClassicAppGateways.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-BasicPublicIPs.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-BasicLoadBalancers.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-BackendlessLoadBalancers.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-BackendlessAppGateways.json Adds custom recommendation query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/queries/Recommendations-Microsoft-AdvisorCost.json Adds Azure Advisor cost recommendations query.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Recommendations/app.bicep Adds Recommendations app module (schema + query upload wiring).
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/IngestionQueries/README.md Documents ingestion query orchestrator + query/schema formats.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/IngestionQueries/metadata.bicep Adds metadata type for IngestionQueries app outputs.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/AzureResourceGraph/README.md Documents ARG query engine app behavior/limits.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/AzureResourceGraph/metadata.bicep Adds metadata type for ARG app outputs.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/AzureResourceGraph/app.bicep Adds ARG engine app (dataset + pipeline to execute queries).
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Analytics/scripts/IngestionSetup_v1_2.kql Enhances Recommendations transform for ARG/Advisor payloads + normalization.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Analytics/scripts/IngestionSetup_HubInfra.kql Fixes parse_resourceid handling for subscription-scope IDs without /providers.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Analytics/scripts/HubSetup_v1_2.kql Adjusts Recommendations projection to include additional columns.
src/templates/finops-hub/modules/Microsoft.CostManagement/Exports/app.bicep Fixes ingestion container variable reference in ADF activity.
src/templates/finops-hub/modules/hub.bicep Wires recommendations modules behind enableRecommendations flag + params.
src/templates/finops-hub/modules/fx/hub-app.bicep Adds ADF self-RBAC + conditions + safer outputs for optional resources.
src/templates/finops-hub/modules/fx/ftkver.txt Bumps hub fx template version to v14 dev.
src/templates/finops-hub/modules/fx/ftktag.txt Bumps hub fx tag to v14.
src/templates/finops-hub/main.bicep Exposes recommendations parameters at top-level deployment.
src/templates/finops-hub/createUiDefinition.json Adds portal UI step for enabling recommendations + optional noisy types.
src/templates/finops-hub/.build.config Adds post-build script hook for generating query file wiring.
src/templates/finops-alerts/modules/ftkver.txt Bumps alerts template version to v14 dev.
src/scripts/Update-Version.ps1 Adds changelog + integration test auto-updates during version bump.
src/scripts/Update-CommitmentDiscountEligibility.ps1 Adds script to generate CommitmentDiscountEligibility open dataset.
src/scripts/Test-PowerShell.ps1 Expands hub test discovery pattern to include new hub integration tests.
src/scripts/README.md Documents new Deploy-Hub options (PR naming, exports, private net, recs).
src/scripts/Get-Version.ps1 Improves tag generation for prerelease versions; minor style tweak.
src/scripts/Deploy-Hub.ps1 Adds PR naming, managed/manual export wiring, private networking, recs toggle.
src/scripts/Build-Toolkit.ps1 Adds support for template-level custom build scripts (post-copy).
src/scripts/Build-HubIngestionQueries.ps1 Generates Recommendations/app.bicep loadTextContent wiring from queries/*.json.
src/powershell/Tests/Unit/HubsIngestionQueries.Tests.ps1 Adds unit tests for query/schema validity + bicep compile check.
src/powershell/Tests/Unit/Get-FinOpsCostExport.Tests.ps1 Adds unit tests for RunHistory expansion/regression coverage.
src/powershell/Tests/Integration/Toolkit.Tests.ps1 Updates planned release list + expected release artifacts.
src/powershell/Tests/Integration/HubsIngestionQueries.Tests.ps1 Adds integration tests that execute ARG queries + validate columns/perf.
src/powershell/Public/Get-FinOpsCostExport.ps1 Fixes nested pipeline $_ collision by extracting run history first.
src/powershell/Private/Get-VersionNumber.ps1 Bumps toolkit version function to v14 dev.
src/optimization-engine/ftkver.txt Bumps optimization engine version to v14 dev.
src/open-data/README.md Adds docs section for the new commitment discount eligibility dataset.
package.json Bumps npm package version to 14.0.0-dev.
package-lock.json Bumps lockfile package version to 14.0.0-dev.
docs/_includes/ftkver.txt Bumps docs include version to v14 dev.
docs/_includes/ftktag.txt Bumps docs include tag to v14.
docs-mslearn/toolkit/workbooks/optimization.md Updates ms.date metadata.
docs-mslearn/toolkit/workbooks/governance.md Updates ms.date metadata.
docs-mslearn/toolkit/workbooks/finops-workbooks-overview.md Updates ms.date metadata.
docs-mslearn/toolkit/workbooks/customize-workbooks.md Updates ms.date metadata.
docs-mslearn/toolkit/roadmap.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/toolkit/get-finopstoolkitversion.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/toolkit/finops-toolkit-commands.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/powershell-commands.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/hubs/remove-finopshubscope.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/hubs/remove-finopshub.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/hubs/register-finopshubproviders.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/hubs/initialize-finopshubdeployment.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/hubs/get-finopshub.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/hubs/finops-hubs-commands.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/hubs/deploy-finopshub.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/data/open-data-commands.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/data/get-finopsservice.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/data/get-finopsresourcetype.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/data/get-finopsregion.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/data/get-finopspricingunit.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/cost/start-finopscostexport.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/cost/remove-finopscostexport.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/cost/new-finopscostexport.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/cost/get-finopscostexport.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/cost/cost-management-commands.md Updates ms.date metadata.
docs-mslearn/toolkit/powershell/cost/add-finopsserviceprincipal.md Updates ms.date metadata.
docs-mslearn/toolkit/power-bi/workload-optimization.md Updates ms.date metadata.
docs-mslearn/toolkit/power-bi/template-app.md Updates ms.date metadata.
docs-mslearn/toolkit/power-bi/setup.md Updates ms.date metadata.
docs-mslearn/toolkit/power-bi/reports.md Updates ms.date metadata.
docs-mslearn/toolkit/power-bi/rate-optimization.md Updates ms.date metadata.
docs-mslearn/toolkit/power-bi/invoicing.md Updates ms.date metadata.
docs-mslearn/toolkit/power-bi/help-me-choose.md Updates ms.date metadata.
docs-mslearn/toolkit/power-bi/governance.md Updates ms.date metadata.
docs-mslearn/toolkit/power-bi/data-ingestion.md Updates ms.date metadata.
docs-mslearn/toolkit/power-bi/cost-summary.md Updates ms.date metadata.
docs-mslearn/toolkit/power-bi/connector.md Updates ms.date metadata.
docs-mslearn/toolkit/optimization-engine/troubleshooting.md Updates ms.date metadata.
docs-mslearn/toolkit/optimization-engine/suppress-recommendations.md Updates ms.date metadata.
docs-mslearn/toolkit/optimization-engine/setup-options.md Updates ms.date metadata.
docs-mslearn/toolkit/optimization-engine/reports.md Updates ms.date metadata.
docs-mslearn/toolkit/optimization-engine/overview.md Updates ms.date metadata.
docs-mslearn/toolkit/optimization-engine/faq.md Updates ms.date metadata.
docs-mslearn/toolkit/optimization-engine/customize.md Updates ms.date metadata.
docs-mslearn/toolkit/optimization-engine/configure-workspaces.md Updates ms.date metadata.
docs-mslearn/toolkit/open-data.md Adds commitment discount eligibility docs + download link; updates ms.date.
docs-mslearn/toolkit/hubs/upgrade.md Updates ms.date metadata.
docs-mslearn/toolkit/hubs/savings-calculations.md Updates ms.date metadata.
docs-mslearn/toolkit/hubs/private-networking.md Updates ms.date metadata.
docs-mslearn/toolkit/hubs/finops-hubs-overview.md Updates ms.date metadata.
docs-mslearn/toolkit/hubs/deploy.md Updates ms.date metadata.
docs-mslearn/toolkit/hubs/data-processing.md Documents recommendations ingestion flow; updates ms.date.
docs-mslearn/toolkit/hubs/data-model.md Updates Recommendations dataset docs to include new sources.
docs-mslearn/toolkit/hubs/configure-scopes.md Clarifies role assignment wording; updates ms.date.
docs-mslearn/toolkit/hubs/configure-remote-hubs.md Updates ms.date metadata.
docs-mslearn/toolkit/hubs/configure-recommendations.md Adds new how-to page for recommendations configuration and custom queries.
docs-mslearn/toolkit/hubs/configure-dashboards.md Updates ms.date metadata.
docs-mslearn/toolkit/hubs/configure-ai.md Updates ms.date metadata.
docs-mslearn/toolkit/hubs/compatibility.md Updates ms.date metadata.
docs-mslearn/toolkit/help/troubleshooting.md Updates ms.date metadata.
docs-mslearn/toolkit/help/terms.md Updates ms.date metadata.
docs-mslearn/toolkit/help/support.md Updates ms.date metadata.
docs-mslearn/toolkit/help/help-options.md Updates ms.date metadata.
docs-mslearn/toolkit/help/errors.md Updates ms.date metadata.
docs-mslearn/toolkit/help/deploy.md Updates ms.date metadata.
docs-mslearn/toolkit/help/data-dictionary.md Updates ms.date metadata.
docs-mslearn/toolkit/finops-toolkit-overview.md Updates ms.date metadata.
docs-mslearn/toolkit/data-lake-storage-connectivity.md Updates ms.date metadata.
docs-mslearn/toolkit/changelog.md Adds v14 content + unreleased hubs vNext note + links; updates ms.date.
docs-mslearn/toolkit/bicep-registry/scheduled-actions.md Updates ms.date metadata.
docs-mslearn/toolkit/bicep-registry/modules.md Updates ms.date metadata.
docs-mslearn/toolkit/alerts/finops-alerts-overview.md Updates ms.date metadata.
docs-mslearn/toolkit/alerts/configure-finops-alerts.md Updates ms.date metadata.
docs-mslearn/TOC.yml Adds TOC entry for configure recommendations page.
docs-mslearn/overview.md Updates ms.date metadata.
docs-mslearn/implementing-finops-guide.md Updates ms.date metadata.
docs-mslearn/framework/understand/understand-cloud-usage-cost.md Updates ms.date metadata.
docs-mslearn/framework/understand/reporting.md Updates ms.date metadata.
docs-mslearn/framework/understand/ingestion.md Updates ms.date metadata.
docs-mslearn/framework/understand/anomalies.md Updates ms.date metadata.
docs-mslearn/framework/understand/allocation.md Updates ms.date metadata.
docs-mslearn/framework/quantify/unit-economics.md Updates ms.date metadata.
docs-mslearn/framework/quantify/quantify-business-value.md Updates ms.date metadata.
docs-mslearn/framework/quantify/planning.md Updates ms.date metadata.
docs-mslearn/framework/quantify/forecasting.md Updates ms.date metadata.
docs-mslearn/framework/quantify/budgeting.md Updates ms.date metadata.
docs-mslearn/framework/quantify/benchmarking.md Updates ms.date metadata.
docs-mslearn/framework/optimize/workloads.md Updates ms.date metadata.
docs-mslearn/framework/optimize/sustainability.md Updates ms.date metadata.
docs-mslearn/framework/optimize/rates.md Updates ms.date metadata.
docs-mslearn/framework/optimize/optimize-cloud-usage-cost.md Updates ms.date metadata.
docs-mslearn/framework/optimize/licensing.md Updates ms.date metadata.
docs-mslearn/framework/optimize/architecting.md Updates ms.date metadata.
docs-mslearn/framework/manage/tools-services.md Updates ms.date metadata.
docs-mslearn/framework/manage/operations.md Updates ms.date metadata.
docs-mslearn/framework/manage/onboarding.md Updates ms.date metadata.
docs-mslearn/framework/manage/manage-finops.md Updates ms.date metadata.
docs-mslearn/framework/manage/invoicing-chargeback.md Updates ms.date metadata.
docs-mslearn/framework/manage/intersecting-disciplines.md Updates ms.date metadata.
docs-mslearn/framework/manage/governance.md Updates ms.date metadata.
docs-mslearn/framework/manage/education.md Updates ms.date metadata.
docs-mslearn/framework/manage/assessment.md Updates ms.date metadata.
docs-mslearn/framework/finops-framework.md Updates ms.date metadata.
docs-mslearn/framework/capabilities.md Updates ms.date metadata.
docs-mslearn/focus/what-is-focus.md Updates ms.date metadata.
docs-mslearn/focus/validate.md Updates ms.date metadata.
docs-mslearn/focus/metadata.md Updates ms.date metadata.
docs-mslearn/focus/mapping.md Updates ms.date metadata.
docs-mslearn/focus/convert.md Updates ms.date metadata.
docs-mslearn/focus/conformance-summary.md Updates ms.date metadata.
docs-mslearn/focus/conformance-full-report.md Updates ms.date metadata.
docs-mslearn/fabric/create-fabric-workspace-finops.md Updates ms.date metadata.
docs-mslearn/conduct-iteration.md Updates ms.date metadata.
docs-mslearn/best-practices/web.md Adds App Service plan best practice + recommendations tie-in; updates ms.date.
docs-mslearn/best-practices/storage.md Reworks storage best practices + adds recs tie-ins; fixes formatting.
docs-mslearn/best-practices/library.md Updates ms.date metadata.
docs-mslearn/best-practices/general.md Adds Azure Advisor best practice + recs tie-in; formatting updates.
docs-mslearn/best-practices/databases.md Adds elastic pool best practice + recs tie-in; formatting updates.
docs-mslearn/best-practices/compute.md Adds AKS Spot + unmanaged disks + AHB best practices + recs tie-ins.
.github/workflows/opendata-commitment-eligibility.yml Adds scheduled workflow to refresh open data CSV via PR.
.github/ISSUE_TEMPLATE/bug.md Adds environment section to bug issue template.

Comment on lines +7 to +11
"source": {
"path": "[['ResourceId']"
},
"sink": {
"path": "ResourceId"
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The TabularTranslator source paths look malformed (e.g., "[['ResourceId']" is missing the closing "]]" and doesn’t use a valid JSONPath-style expression). As written, ADF column mapping will likely fail for every mapped column. Please update all mappings to use the correct source path syntax (and keep it consistent with the actual shape under collectionReference "$['data']").

Copilot uses AI. Check for mistakes.
Comment on lines +123 to +127
body: {
value: '@concat(\'{ "query": "\', pipeline().parameters.query, \' | count" }\')'
type: 'Expression'
}
authentication: {
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The WebActivity request body is constructed by concatenating the raw query text into a JSON string. If the query contains double quotes or backslashes (possible for custom queries), this will produce invalid JSON and the activity will fail. Escape/encode pipeline().parameters.query before inserting it into the JSON body (and apply the same fix to the later Copy activity requestBody).

Copilot uses AI. Check for mistakes.
Comment on lines +168 to +173
requestMethod: 'POST'
// Query text is from trusted config/queries/*.json files; no escaping needed.
requestBody: {
value: '@concat(\'{ "query": "\', pipeline().parameters.query, \' | extend x_SourceName=\\"\', pipeline().parameters.querySource, \'\\", x_SourceType=\\"\', pipeline().parameters.queryType, \'\\", x_SourceProvider=\\"\', pipeline().parameters.queryProvider, \'\\", x_SourceVersion=\\"\', pipeline().parameters.queryVersion, \'\\"" }\')'
type: 'Expression'
}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The Copy activity requestBody concatenates query + metadata into a JSON string and also injects querySource/queryType/queryProvider/queryVersion directly into KQL string literals. If any of these values include a quote/backslash (or if the query contains quotes), the JSON and/or KQL will break, and it also creates an injection surface for config-supplied values. Please JSON-escape the query string, and KQL-escape the injected metadata values (or pass metadata separately if possible).

Copilot uses AI. Check for mistakes.
Comment on lines +133 to +141
Write-Warning "Unknown query group '$groupName' found; adding as opt-in variable"
$varName = "${groupName}QueryFiles"
$paramName = "enable$($groupName.Substring(0,1).ToUpper())$($groupName.Substring(1))Recommendations"
$varNames += $varName

$generatedLines += ''
$generatedLines += "// Optional: $groupName recommendations"
$generatedLines += Format-BicepVar $varName $groups[$groupName] "$paramName ?"
}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

For unknown query groups, the script emits a variable conditioned on a parameter name (e.g., enableRecommendations) that isn’t guaranteed to exist in app.bicep. This will make the built template fail to compile if someone adds a new group without also adding the corresponding parameter. Prefer failing fast (throw) with a clear message, or default unknown groups into core (always included) until explicitly wired up.

Copilot uses AI. Check for mistakes.
Comment on lines 54 to 58
4. After ingestion, the **ingestion_ETL_dataExplorer** pipeline performs some cleanup, including purging data in the final table that is past the data retention period.
- As of 0.7, Data Explorer applies data retention in raw tables while data retention in final tables is applied by the ingestion pipeline. If data ingestion stops, historical data isn't purged.
- Data retention can be configured during the template deployment or manually in the **config/settings.json** file in storage.
6. (Optional) The **queries_DailySchedule** trigger runs the **queries_ExecuteETL** pipeline once per day to query Azure Resource Graph for additional recommendations and saves results to the **ingestion/Recommendations** folder. [Learn more](configure-recommendations.md).
6. (Optional) The **queries_DailySchedule** trigger runs the **queries_ExecuteETL** pipeline once per day to query Azure Resource Graph for additional recommendations and saves results to the **ingestion/Recommendations** folder. [Learn more](#recommendation-data-transforms).
7. Reports and other tools like Power BI read data from Data Explorer or the **ingestion** container.
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

This link points to #recommendation-data-transforms, but the section added below is titled "Azure Resource Graph recommendations" so the generated anchor won’t match. Update the link target to the correct heading anchor to avoid a broken in-page link.

Copilot uses AI. Check for mistakes.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants