Conversation
There was a problem hiding this comment.
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.ps1helper wrapper for ADX (default), storage-only, and Fabric scenarios, plus a-Removecleanup mode. - Updated
src/scripts/README.mdto documentDeploy-Hubusage 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. |
| Write-Host "Deleting resource group '$rgName'..." | ||
| Remove-AzResourceGroup -Name $rgName -Force | ||
| Write-Host "Deleted '$rgName'." |
There was a problem hiding this comment.
-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.
| 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'." | |
| } |
| # List all resource groups matching the initials-* pattern | ||
| $pattern = "$initials-*" | ||
| $groups = Get-AzResourceGroup | Where-Object { $_.ResourceGroupName -like $pattern } | ||
| if ($groups.Count -eq 0) |
There was a problem hiding this comment.
$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.
| if ($groups.Count -eq 0) | |
| if (-not $groups) |
| <# | ||
| .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). |
There was a problem hiding this comment.
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).
🛠️ Description
Add
Deploy-Hub.ps1, a wrapper aroundDeploy-Toolkitthat simplifies FinOps hub deployments for local testing by providing scenario-based flags instead of requiring you to remember all the Bicep parameter names.{initials}-{name}naming convention (initials fromgit config user.name, name defaults toadx)-StorageOnly), and Fabric (-Fabric) deployment scenarios-Removemode to list or delete test resource groupssrc/scripts/README.md📋 Checklist
🔬 How did you test this change?
🙋♀️ Do any of the following that apply?
📑 Did you update
docs/changelog.md?📖 Did you update documentation?