Skip to content

Comments

Add Deploy-Hub helper script#2008

Open
flanakin wants to merge 1 commit intodevfrom
flanakin/deploy-hub-script
Open

Add Deploy-Hub helper script#2008
flanakin wants to merge 1 commit intodevfrom
flanakin/deploy-hub-script

Conversation

@flanakin
Copy link
Collaborator

🛠️ Description

Add Deploy-Hub.ps1, a wrapper around Deploy-Toolkit that simplifies FinOps hub deployments for local testing by providing scenario-based flags instead of requiring you to remember all the Bicep parameter names.

  • Uses {initials}-{name} naming convention (initials from git config user.name, name defaults to adx)
  • Supports ADX (default), storage-only (-StorageOnly), and Fabric (-Fabric) deployment scenarios
  • Includes -Remove mode to list or delete test resource groups
  • Documented in src/scripts/README.md

📋 Checklist

🔬 How did you test this change?

  • 🤏 Lint tests
  • 🤞 PS -WhatIf / az validate

🙋‍♀️ 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?

  • ❎ Log not needed (small/internal change)

📖 Did you update documentation?

  • ✅ Internal dev docs in src (required for dev)

Copilot AI review requested due to automatic review settings February 17, 2026 06:31
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Review 👀 PR that is ready to be reviewed label Feb 17, 2026
@microsoft-github-policy-service microsoft-github-policy-service bot added the Skill: DevOps GitHub setup and automation label Feb 17, 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

Adds a new PowerShell helper to streamline local FinOps hub deployments by wrapping Deploy-Toolkit with scenario-based flags, and documents the new workflow in the scripts README.

Changes:

  • Added src/scripts/Deploy-Hub.ps1 helper wrapper for ADX (default), storage-only, and Fabric scenarios, plus a -Remove cleanup mode.
  • Updated src/scripts/README.md to document Deploy-Hub usage and examples.
  • Minor markdown cleanup in src/scripts/README.md (formatting consistency in later sections).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/scripts/Deploy-Hub.ps1 New wrapper script around Deploy-Toolkit to simplify local FinOps hub deployments and test-environment cleanup.
src/scripts/README.md Adds a new Deploy-Hub section and updates the table of contents; small markdown formatting fixes.

Comment on lines +154 to +156
Write-Host "Deleting resource group '$rgName'..."
Remove-AzResourceGroup -Name $rgName -Force
Write-Host "Deleted '$rgName'."
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

-WhatIf is accepted by this script but ignored in -Remove mode, so Deploy-Hub -Remove -WhatIf <name> would still delete the resource group. Please honor -WhatIf during removal (for example, pass it through to Remove-AzResourceGroup or short-circuit deletion when -WhatIf is set) to avoid accidental deletions.

Suggested change
Write-Host "Deleting resource group '$rgName'..."
Remove-AzResourceGroup -Name $rgName -Force
Write-Host "Deleted '$rgName'."
if ($WhatIf)
{
# WhatIf mode: do not delete, just report the intended action
Write-Host "WhatIf: would delete resource group '$rgName'."
}
else
{
Write-Host "Deleting resource group '$rgName'..."
Remove-AzResourceGroup -Name $rgName -Force
Write-Host "Deleted '$rgName'."
}

Copilot uses AI. Check for mistakes.
# List all resource groups matching the initials-* pattern
$pattern = "$initials-*"
$groups = Get-AzResourceGroup | Where-Object { $_.ResourceGroupName -like $pattern }
if ($groups.Count -eq 0)
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

$groups may be $null (no matches) or a single PSResourceGroup object (1 match), in which case $groups.Count isn't reliable. Use a null/empty check (e.g., if (-not $groups) or @($groups).Count) so the "no resource groups found" path behaves correctly.

Suggested change
if ($groups.Count -eq 0)
if (-not $groups)

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +13
<#
.SYNOPSIS
Deploys a FinOps hub instance for local testing.

.DESCRIPTION
Wrapper around Deploy-Toolkit that simplifies FinOps hub deployments by providing scenario-based flags instead of requiring you to remember all the Bicep parameter names.

By default, deploys with Azure Data Explorer (dev SKU). Use -StorageOnly for storage-only or -Fabric for Fabric-based deployments.

All resources use an "{initials}-{name}" naming convention where initials are pulled from git config user.name and name defaults to "adx". Pass a name as the first positional parameter to use a custom value (e.g., "216" for Feb 16).
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

This PR adds a new helper command. The repo release process states that new/updated functionality must be documented in docs-mslearn/toolkit/changelog.md; please add an entry under the next release section describing the new Deploy-Hub helper (customer-friendly, no internal implementation details).

Copilot uses AI. Check for mistakes.
@flanakin flanakin added this to the v14 milestone Feb 23, 2026
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 Skill: DevOps GitHub setup and automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants