Skip to content

Add interactive capacity_migration UI - #1234

Draft
m-kovalsky with Copilot wants to merge 2 commits into
mainfrom
copilot/add-migration-tool-ui
Draft

Add interactive capacity_migration UI#1234
m-kovalsky with Copilot wants to merge 2 commits into
mainfrom
copilot/add-migration-tool-ui

Conversation

Copilot AI commented May 18, 2026

Copy link
Copy Markdown
Contributor

Adds labs.capacity_migration(), an anywidget-based UI (styled after perspective_editor) that drives the workflows in the Capacity Migration.ipynb notebook for migrating P/A SKU capacities to F SKU capacities.

UI

  • Three tabs matching the supported scenarios:
    • Single capacity — pick a P/A source, then either create a new F SKU (live preview of target name, mapped F SKU size, region, admins, and whether the target already exists) or reassign workspaces to an existing F SKU.
    • Multiple capacities — multi-select P/A SKUs with a P SKUs only toggle.
    • All P/A capacities — region-grouped summary + P SKUs only toggle.
  • Cross-region guard: the existing-F-SKU dropdown is filtered to the source's region; a Python-side check rejects mismatched regions before invoking assign_workspaces_to_capacity.
  • Confirmation prompt before each migration, refresh button (re-queries list_capacities), inline status panel, dark/light toggle.

Wiring

  • Source list_capacities() powers the source/target dropdowns; icons.sku_mapping and icons.migrate_capacity_suffix drive the target preview.
  • Single-create / multiple / all paths call migrate_capacities(...); single-existing calls assign_workspaces_to_capacity(...).
  • Optional Service Principal Authentication section — when enabled, each action is wrapped in service_principal_authentication(...). Initial values can be pre-populated from function arguments so the existing notebook variables carry through.

Files

  • src/sempy_labs/_capacity_migration_ui.py — new module.
  • src/sempy_labs/__init__.py — export capacity_migration.
  • notebooks/Capacity Migration.ipynb — new section demonstrating the UI:
labs.capacity_migration(
    azure_subscription_id=azure_subscription_id,
    resource_group=resource_group,
    key_vault_uri=key_vault_uri,
    key_vault_tenant_id=key_vault_tenant_id,
    key_vault_client_id=key_vault_client_id,
    key_vault_client_secret=key_vault_client_secret,
)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants