#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 its components and their data, including tables and their rows (Microsoft Learn: Delete a solution). There is no recycle bin. Open the solution first and check that it contains only what you want to remove. Back up the table data you may still need before you start (see step 3).
💡 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. It holds only the component definitions (apps, flows, table definitions), no table rows and no flow run history: solutions don’t contain business data (ALM basics). Export the rows you may still need separately before step 6.
🔸 Keep an editable source of anything you may rebuild, for example an unmanaged export of the same solution. -
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.🔸 Rehearse steps 3 to 6 once with a throwaway solution (one test app) in a test environment before you run them on real components. How the import behaves over components that still exist unmanaged depends on the component type and the layers they already have.
-
Delete the managed solution.
🔸 This removes every component it contains in one step. There is no further confirmation per component. It only works if nothing else depends on those components: a dependency, or a layer that another solution adds on top, can block the uninstall, and for managed tables the rows are deleted with them (Removing dependencies overview). Check the dependencies first, as in step 2.
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: according to the current pac canvas reference, pac canvas offers create, download, list, pack and unpack (no delete), and there is no pac flow command group; the preview group pac power-automate only lists flows, flow actions and runs. The command set changes between versions, so check pac help for yours. There is no single-component delete command in the CLI, but for individual components you do not need the managed-solution route: in the portal open the solution, select the component and choose Remove > Delete from this environment.
🎉 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. Decide what to keep before you export: in the unmanaged source solution, remove every component you want to keep from the cleanup solution, not from the environment (putting it in a second solution as well is not enough, because it would still be in the cleanup export), verify the cleanup solution’s contents, and only then export as managed. For a managed solution that is already installed, you can’t pick components out of it in the target; check dependencies and layers, or import an updated version with the Upgrade action (Upgrade or update a solution).
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, which runs free live workshops (in German). See the next free workshop dates (in German). For companies that want this implemented for them, see KMUpower: Power Platform consulting & automation for SMEs (DACH).