Skip to content

[Demo] Export the billing account and keep 36 months for the latest version - #2403

Merged
Michael Flanakin (flanakin) merged 3 commits into
devfrom
flanakin/demo-hub-billing-account
Nov 1, 2026
Merged

Michael Flanakin (flanakin) merged 3 commits into
devfrom
flanakin/demo-hub-billing-account

Conversation

@flanakin

Copy link
Copy Markdown
Collaborator

Fixes the v15 demo hub (ftk-demo-v15) only having October data. It exported the FTK Prod subscription instead of the demo billing account, which had almost no cost before October.

  • Defaults the current demo hub and the version being built to the demo EA billing account. The subscription is inside it, so exporting both duplicates costs (see configure scopes).
  • Grants the hub's identity the Enterprise Administrator (read only) billing role on EA billing accounts. The script only handled subscriptions and management groups and warned for anything else, so a new hub never exported the billing account.
  • Removes exports on scopes that are no longer exported. Data they already delivered stays and has to be removed separately.
  • Keeps 36 months for the version being built, not just the unversioned ftk-demo.

Not run end to end yet. A dry run with -WhatIf passes. The real run on ftk-demo-v15 is pending.

🤖 Generated with Claude Code

… latest version

- Default the current demo hub and the version being built to the demo EA billing account instead of the subscription, which is inside it and would duplicate costs.
- Grant the hub's identity the Enterprise Administrator (read only) billing role on EA billing accounts. Only subscriptions and management groups were handled, so billing account exports never started for new hubs.
- Remove exports on scopes that are no longer exported.
- Keep 36 months for the version being built, not just the unversioned demo hub.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The approach is right. Per the description, it hasn't run end to end yet. Two points before the real run on ftk-demo, plus one on the data it already has.

Comment thread src/scripts/Deploy-Demo.ps1 Resolved
Comment thread src/scripts/Deploy-Demo.ps1 Resolved
Comment thread src/scripts/README.md Resolved
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Check status codes when listing and deleting stale exports
- Only treat a missing settings.json as no scopes
- Document removing data left by the old scope

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

Co-Authored-By: RolandKrummenacher <RolandKrummenacher@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, all three points are addressed. I checked them in the code: the stale-export cleanup now checks status codes on both the list and the delete, Get-DemoScope only treats a missing settings.json as no scopes and lets everything else retry, and the README covers clearing the old scope's data.

The new viewer step looks right. aaduser=#everyone# and msauser=#everyone# are the documented "everyone" principals, and with trustedExternalTenants unset the cluster accepts all tenants. Two non-blocking points:

  • The PR description doesn't mention that the demo hub databases are now readable by anyone. Please add it, since it changes who can access the data.
  • It still hasn't run end to end. Worth checking .show database Hub principals after the real run on ftk-demo-v15.

Comment thread src/scripts/Deploy-Demo.ps1 Resolved
Comment thread src/scripts/Deploy-Demo.ps1 Resolved
Comment thread src/scripts/Deploy-Demo.ps1 Resolved
Comment thread src/scripts/Deploy-Demo.ps1 Resolved
Comment thread src/scripts/README.md Resolved
@flanakin
Michael Flanakin (flanakin) merged commit a47aaf7 into dev Nov 1, 2026
5 checks passed
@flanakin
Michael Flanakin (flanakin) deleted the flanakin/demo-hub-billing-account branch November 1, 2026 20:50

This branch was successfully deployed

1 active deployment
ftk-pr — 5d5d0b56 Deployed Nov 1, 2026 by flanakin via Clean up PR resources #92
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 Status: 🤖 Autopilot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants