Skip to content

Merge dev into features/hubs-recs#2066

Open
flanakin wants to merge 11 commits intofeatures/hubs-recsfrom
flanakin/merge-dev-to-hubs-recs-2
Open

Merge dev into features/hubs-recs#2066
flanakin wants to merge 11 commits intofeatures/hubs-recsfrom
flanakin/merge-dev-to-hubs-recs-2

Conversation

@flanakin
Copy link
Collaborator

🛠️ Description

Merge latest dev into features/hubs-recs to resolve merge conflicts before merging to dev.

Conflict resolutions:

  • configure-scopes.md: Kept newer date (03/14)
  • ftktag.txt (2 files): Took dev's released v14 tag
  • Update-Version.ps1: Took dev's consistent $releaseTag formatting (keeps v prefix)

📋 Checklist

🔬 How did you test this change?

  • 🤏 Lint tests
  • 🤞 PS -WhatIf / az validate
  • 👍 Manually deployed + verified
  • 💪 Unit tests
  • 🙌 Integration tests

🙋‍♀️ Do any of the following that apply?

  • 🚨 This is a breaking change.
  • 🤏 The change is less than 20 lines of code.

📑 Did you update docs/changelog.md?

  • ✅ Updated changelog (required for dev PRs)
  • ➡️ Will add log in a future PR (feature branch PRs only)
  • ❎ Log not needed (small/internal change)

📖 Did you update documentation?

  • ✅ Public docs in docs (required for dev)
  • ✅ Public docs in docs-mslearn (required for dev)
  • ✅ Internal dev docs in docs-wiki (required for dev)
  • ✅ Internal dev docs in src (required for dev)
  • ➡️ Will add docs in a future PR (feature branch PRs only)
  • ❎ Docs not needed (small/internal change)

flanakin and others added 4 commits March 14, 2026 13:22
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: RolandKrummenacher <[email protected]>
# Conflicts:
#	docs-mslearn/toolkit/hubs/configure-scopes.md
#	docs/_includes/ftktag.txt
#	src/scripts/Update-Version.ps1
#	src/templates/finops-hub/modules/fx/ftktag.txt
Copilot AI review requested due to automatic review settings March 21, 2026 12:44
@microsoft-github-policy-service microsoft-github-policy-service bot added Micro PR 🔬 Very small PR that should be especially easy for newcomers Needs: Review 👀 PR that is ready to be reviewed labels Mar 21, 2026
Copy link
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

Merges the latest dev branch into features/hubs-recs, resolving conflicts and aligning version/tag handling and FinOps hub deployment scripts/docs with the current dev state.

Changes:

  • Updates FinOps hub template logic for Data Factory RBAC and makes several hub-app outputs conditional when optional components aren’t deployed.
  • Aligns version/tag handling to the released v14 tag across templates/docs and updates changelog formatting/links.
  • Expands local deployment tooling/docs (Deploy-Hub) with additional parameters and examples (PR naming, scope/exports options).

Reviewed changes

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

Show a summary per file
File Description
src/templates/finops-hub/modules/fx/hub-app.bicep Refines ADF RBAC role assignment behavior and makes outputs safe when optional resources aren’t deployed.
src/templates/finops-hub/modules/fx/ftktag.txt Updates template tag to released v14.
src/scripts/Update-Version.ps1 Adjusts changelog section/tag parsing to consistently use v-prefixed tags and correct compare links.
src/scripts/README.md Updates Deploy-Hub parameter documentation and adds examples for PR naming and exports scenarios.
src/scripts/Get-Version.ps1 Ensures -AsTag returns a stable released tag by stripping prerelease suffixes.
src/scripts/Deploy-Hub.ps1 Adds new deployment options (PR naming, recommendations, scope/exports flow) and post-deploy export configuration logic.
docs/_includes/ftktag.txt Updates docs include tag to v14.
docs-mslearn/toolkit/hubs/configure-scopes.md Clarifies required role assignment (Cost Management Contributor) for managed exports scopes.
docs-mslearn/toolkit/changelog.md Adds v14 release header metadata/links and corrects v13 release date formatting.

Comment on lines +227 to +232
# Hub name — use "{pr}{name}{initials}" when -PR or -Name is specified, otherwise "hub"
if ($HubName) { $params.hubName = $HubName }
elseif ($PR -or $PSBoundParameters.ContainsKey('Name'))
{
$explicitName = if ($PSBoundParameters.ContainsKey('Name')) { $Name } else { $null }
$hubParts = @($PR, $explicitName, $initials) | Where-Object { $_ }
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

When -PR is used, $initials is set to "pr-$PR", but later the default hub name is built from @($PR, $explicitName, $initials), which repeats the PR value and produces unexpected names (for example 123adxpr123). Consider keeping user initials separate from the PR prefix and deriving hubName from a single canonical value (for example based on $fullName) to avoid surprising resource naming.

Suggested change
# Hub name — use "{pr}{name}{initials}" when -PR or -Name is specified, otherwise "hub"
if ($HubName) { $params.hubName = $HubName }
elseif ($PR -or $PSBoundParameters.ContainsKey('Name'))
{
$explicitName = if ($PSBoundParameters.ContainsKey('Name')) { $Name } else { $null }
$hubParts = @($PR, $explicitName, $initials) | Where-Object { $_ }
# Hub name — when -PR or -Name is specified, derive from the explicit name and initials; otherwise use "hub"
if ($HubName) { $params.hubName = $HubName }
elseif ($PR -or $PSBoundParameters.ContainsKey('Name'))
{
$explicitName = if ($PSBoundParameters.ContainsKey('Name')) { $Name } else { $null }
# Build hub name parts without duplicating the PR value (initials may already include a PR prefix)
$hubParts = @($explicitName, $initials) | Where-Object { $_ }

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤖 [AI][Claude] ✅ Implemented

Good catch. Removed $PR from the hub name array since $initials already includes it (as pr-{number}). The array is now @($explicitName, $initials) which avoids duplicating the PR number.

Comment on lines +348 to +354
New-FinOpsCostExport -Name "ftk-focuscost" `
-Scope $Scope `
-Dataset "FocusCost" `
-StorageAccountId $storageAccountId `
-StorageContainer "msexports" `
-DoNotOverwrite `
-Execute
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

Manual export creation uses a constant export name (ftk-focuscost). New-FinOpsCostExport updates an existing export when the name already exists in the same scope, so reusing this script across environments/scopes can inadvertently modify an unrelated export. Consider incorporating the hub name (or $fullName) into the export name to avoid collisions.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤖 [AI][Claude] 🤔 Needs discussion

The constant export name ftk-focuscost is intentional. We want to consistently manage the same export across deployments to the same scope, rather than creating duplicate exports per environment. The -DoNotOverwrite flag prevents accidental modification of existing exports.

Comment on lines +183 to +195
| Parameter | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `‑Name` | Optional. First positional parameter. Suffix for `{initials}-{name}` convention. Default: `adx`. |
| `‑HubName` | Optional. Name of the hub instance. Default: `hub`. |
| `‑ADX` | Optional. Name of the Azure Data Explorer cluster. Overrides the `{initials}-{name}` convention. |
| `‑ResourceGroup` | Optional. Name of the resource group. Overrides the `{initials}-{name}` convention. |
| `‑Fabric` | Optional. Deploy with Microsoft Fabric. Provide the eventhouse query URI. |
| `‑StorageOnly` | Optional. Deploy a storage-only hub (no Azure Data Explorer or Fabric). |
| `‑Remove` | Optional. Remove test environments. With a name, deletes the target RG. Alone, lists all `{initials}-*`. |
| `‑PR` | Optional. PR number for CI deployments. Resources are named `pr-{number}` or `pr-{number}-{name}` when `-Name` is also specified. |
| `‑Scope` | Optional. Azure scope ID for cost data exports (e.g., `/subscriptions/{id}`). With `-ManagedExports`, enables managed exports. Without it, creates exports manually. |
| `‑ManagedExports` | Optional. Use managed exports instead of manual exports. Requires `-Scope`. Passes `scopesToMonitor` to the template and grants the hub identity required roles. |
| `‑Location` | Optional. Azure location. Default: `westus`. |
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

Deploy-Hub.ps1 now includes a -Recommendations switch, but the Deploy-Hub parameter table does not list it. Update this table (and ideally add a short example) so readers can discover and understand the new flag.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤖 [AI][Claude] ✅ Implemented

Added -Recommendations to the README parameter table.

Comment on lines 104 to 108
[Parameter(Position = 0)]
[string]$Name,
[string]$PR,
[string]$HubName,
[string]$ADX,
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

Deploy-Hub.ps1 declares the PR parameter twice in the param(...) block ([string]$PR and later [int]$PR). PowerShell does not allow duplicate parameter names, so the script will fail to parse. Remove one declaration and keep a single, consistently-typed PR parameter.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤖 [AI][Claude] ✅ Implemented

Already fixed in PR #2062. Merged latest dev into this branch which includes the fix (single [int]$PR declaration).

Comment on lines +85 to +87
.PARAMETER PR
Optional. PR number for CI deployments. Resources are named "pr-{number}" or "pr-{number}-{name}" when -Name is also specified.

Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The comment-based help documents .PARAMETER PR twice with different descriptions. Consolidate this into a single .PARAMETER PR entry and ensure the description matches the actual naming behavior implemented in the script.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤖 [AI][Claude] ✅ Implemented

Already fixed in PR #2062. Merged latest dev into this branch which includes the consolidated .PARAMETER PR help block.

RolandKrummenacher and others added 5 commits March 23, 2026 11:26
…RunHistory (#2062)

Co-authored-by: Roland Krummenacher <[email protected]>
Co-authored-by: Michael Flanakin <[email protected]>
Co-authored-by: Roland Krummenacher <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Roland Krummenacher <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Michael Flanakin <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…hubs-recs-2

# Conflicts:
#	docs-mslearn/toolkit/changelog.md
#	docs-mslearn/toolkit/hubs/data-processing.md
#	docs-mslearn/toolkit/open-data.md
- Fix hub name PR number duplication: remove $PR from hub name
  array since $initials already includes it as "pr-{number}"
- Add -Recommendations parameter to README Deploy-Hub table

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: copilot-pull-request-reviewer <[email protected]>
Co-Authored-By: Claude <[email protected]>
@flanakin
Copy link
Collaborator Author

🤖 [AI][Claude] PR Update Summary

Addressed: 5 thread(s)

  • ✅ Implemented: 4
  • 🤔 Needs discussion: 1

Changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Micro PR 🔬 Very small PR that should be especially easy for newcomers Needs: Review 👀 PR that is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants