#PowerPlatformTip 40: 'Delete Apps / Flows'
TL;DR: Bulk-delete old apps and flows by gathering them in a solution, exporting as managed, reimporting, then deleting the managed solution.
⚠️ Warning - this deletes without asking again. Deleting a managed solution deletes all the components in it as well as any related data, including tables and their rows, and there is no recycle bin for it. Open the solution first and check that it contains only what you really want to remove. Export a backup of anything you may still need.
💡 Challenge
A workspace cluttered with outdated test apps and flows is hard to manage. Deleting them one by one is slow and error-prone.
✅ Solution
Gather only the apps and flows you want to remove into a dedicated solution, then use the export/reimport-as-managed technique to delete them in bulk. Everything in that solution is removed together, so never add components you still need.
🔧 How It’s Done
-
Build the cleanup solution.
🔸 Create a new solution and add the apps and flows you want to remove (Add existing).
🔸 Review every component. Remove anything you want to keep, in particular tables, because their data is deleted with them. -
Check dependencies.
🔸 Use Show dependencies on the components and make sure no other solution, app or flow still needs them, including connection references and environment variables. -
Export the solution as managed.
🔸 Keep the exported .zip as your backup. -
Delete the unmanaged solution.
🔸 This removes only the container. All apps and flows remain in your environment. -
Import the managed solution.
🔸 The components are now part of a managed solution in this environment. -
Delete the managed solution.
🔸 This removes every component it contains in one step. There is no further confirmation per component.
For a handful of items you don’t need the round trip: open the solution, select the component and choose Remove > Delete from this environment.
⌨️ The same cleanup from the command line
Steps 5 and 6 also run without the portal (Power Platform CLI 2.11.1):
1
2
3
pac solution import --path <managed solution>.zip --environment <environment id>
pac solution list --environment <environment id>
pac solution delete --solution-name <unique name> --environment <environment id>
pac solution list prints Unique Name, Friendly Name, Version and Managed for every solution, which is where you copy the unique name from. pac solution delete takes only --solution-name and --environment, there is no confirmation prompt and no dry-run switch, so the warning at the top applies twice.
Deleting single apps or flows is not part of the CLI: pac canvas offers download, list, pack, unpack, validate and create, and there is no pac flow command group at all. For individual components the managed-solution route in this tip stays the way to go.
🎉 Result
The test apps and flows in the solution are removed in one go, leading to a more streamlined and organized working environment.
🌟 Key Advantages
🔸 Efficient cleanup of large numbers of apps or flows.
🔸 Maintains a neat and organized workspace.
🔸 Removes everything in the solution in one step instead of item by item.
🎥 Video Tutorial
🛠️ FAQ
1. Can I recover apps or flows after deleting a managed solution?
Not from within the environment: deleting a managed solution removes its components, and you should treat that as permanent. Always back up or export important items before deletion.
2. What happens to data stored in Dataverse tables when I delete apps?
Deleting an app does not delete the underlying Dataverse data. But if the solution you delete contains custom tables, those tables and their data are removed with it, so check the solution contents first.
3. Can I selectively delete some apps while keeping others in the same solution?
No, solution deletion is all-or-nothing. To keep some items, remove them from the solution before deletion or create separate solutions.
4. Can I script the deletion?
Yes, for the solution step: pac solution delete --solution-name <unique name> --environment <environment id> removes the solution, and with a managed solution that removes its components as well. There is no CLI command that deletes a single canvas app or flow, so the solution still has to contain exactly what you want gone.
🔗 Related Tips
🔸 How to Restore and Create a Backup from a Flow - export a backup of anything worth keeping before you run this cleanup.
🔸 #PowerPlatformTip 20: ‘Change Flow Owner’ - another solution-aware operation worth knowing before you manage solutions in bulk.
This tip is by Marcel Lehmann, Microsoft MVP (Business Applications) and founder of the Power Platform Academy – live Power Platform workshops, free or CHF 49. Join the workshop waitlist to get notified about new dates. For companies that want this implemented for them, see KMUpower – Power Platform consulting & automation for SMEs (DACH).