Skip to content

[FEATURE] delete MPE on workspace when --force is set #73

@Guust-Franssens

Description

@Guust-Franssens

Use Case / Problem

This was previously listed as a bug, however after feedback this instead should be a feature.

Currently when a workspace contains a Managed Private Endpoint (MPE) it will prevent the workspace from being deleted even when --force is set. This is inline with the current Fabric Portal:

Image

As the user is passing --force and thus wants to delete the workspace with all of its contents IMO it makes sense to delete the workspace regardless of MPEs being active on the workspace.

Proposed Solution

When --force is applied, first check whether there are any MPEs active. If yes, delete them and then proceed to delete the workspace. The output of the CLI would then give something like this:

$ fab rm ws1.Workspace -f
This will delete 0 underlying items
! Executing force delete
Deleting 'mpe1.ManagedPrivateEndpoint'...
* 'mpe1.ManagedPrivateEndpoint' deleted
! Executing force delete
Deleting 'ws1.Workspace'...
* 'ws1.Workspace' deleted

Alternatives Considered

Alternatives currently is to first list MPEs of a workspace, iteratively delete those and only then delete the workspace. This feels like a lot of extra steps.

Impact Assessment

  • This would help me personally
  • This would help my team/organization
  • This would help the broader fabric-cli community
  • This aligns with Microsoft Fabric roadmap items

Implementation Attestation

  • I understand this feature should maintain backward compatibility with existing commands
  • I confirm this feature request does not introduce performance regressions for existing workflows
  • I acknowledge that new features must follow fabric-cli's established patterns and conventions

Implementation Notes

Logic could be something like this, of course open for discussion :)

if force_delete:
    managed_private_endpoints = utils_mem_store.get_managed_private_endpoints_for_workspace(workspace)
    for managed_private_endpoint in managed_private_endpoints:
        args_ = deepcopy(args)
        args_.id = managed_private_endpoint.id
        args_.name = managed_private_endpoint.name
        if managedprivateendpoint_api.delete_managed_private_endpoint(args_, force_delete):
            utils_mem_store.delete_managed_identity_from_cache(managed_private_endpoint)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions