Skip to content

[PowerShell] Deploy-FinOpsHub resets unspecified options on redeploy #2399

Open

Description

📝 Scenario

As a FinOps hub admin, I need Deploy-FinOpsHub to keep my existing hub's options on redeploy in order to upgrade without silently resetting settings I didn't re-specify.

⚠️ Problem

Deploy-FinOpsHub only passes the four retention values when you specify them (#2206, #2348). Every other option is always sent, so an unspecified option resets to the command's default on an existing hub: StorageSku (Premium_LRS), EnableManagedExports, EnableInfrastructureEncryption, EnablePurgeProtection (switches become false), VirtualNetworkAddressPrefix, ScopesToMonitor (empty), network mode (public), and tags. Recommendation options (enableRecommendations, enableAHBRecommendations, enableSpotRecommendations) can't be set from the command at all.

💎 Solution

Only send an option when the user specifies it, as retention already does, so the template keeps the current value; add the missing recommendation parameters. Where the template can't "keep current", read the existing hub and fill in the value.

📋 Tasks

  • Pass options only when bound, for each option above
  • Add recommendation parameters to Deploy-FinOpsHub
  • Unit tests: redeploy without options does not change existing values
  • Docs and changelog

✅ Acceptance

  • Redeploying an existing hub with only -Name, -ResourceGroupName, and -Location leaves every option unchanged.

ℹ️ Additional context

Complements the parameter-file command in the portal upgrade issue. Raised in PR #2394 review.

🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions