Restore the Deleted Power Automate Flows & Power Apps
If the user mistakenly deleted the Power Automate Flow / Power Apps or as an admin you deleted and want to restore the deleted Power Automate Flow / Power Apps then follow the below steps to easily restore.
Prerequisites
- You should be the Power Platform Environment Admin
- Should have the latest version of PowerShell cmdlets for Power Apps
- There must be an Execution policy set on your device to run PowerShell scripts
How to set up/install PowerShell cmdlets on your machine?
- Search for PowerShell in your machine & “Run as Administrator”
- Latest version of PowerShell cmdlets can be found here
Latest version when writing this blog:
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -RequiredVersion 2.0.147
Steps to Restore the Flow(s)
- Sign in to Power Platform Environment using the below code
- Login screen pops-up
- Provide user name and password to connect to the Power Platform environment where Flow/App needs to be restored
Add-PowerAppsAccount
- Run the below code to get the list of deleted Flows within the last 28 days
//Get-AdminFlow -EnvironmentName 'Environment Name' -IncludeDeleted $true
Get-AdminFlow -EnvironmentName Default-31fd69b3-0535-4506-8d24-6674fc42002b -IncludeDeleted $true
- You can get the Environment name from the Power Automate Flow URL
- It lists out all the deleted Flow(s)
- Select the FlowName which you want to restore
- Run the below code to restore the deleted Flow
//Restore-AdminFlow -EnvironmentName 'Environment Name' -FlowName 'Flow Name which you want to restore'
Restore-AdminFlow -EnvironmentName Default-31fd69b3-0535-4506-8d24-6674fc42002b -FlowName 43e8eda9-bd55-47e0-8bc8-9ecdf864f55c
- Navigate to the Power Automate Portal Page & Check the Flow
- Flow might have been restored and it will be in disabled mode
- Turn on the Flow to run
Restore Deleted Power Apps
- Signin to Power Platform Environment : Add-PowerAppsAccount
- Run the code to list out all the deleted Power apps
- Get the Power App Name from the listing which you want to restore
- Run the code to restore the Power app
- Check the Power App Portal
- App might have been restored with the name appended with “_RestoredYYYYMMDDHHMM”
Points to remember
- The above steps will work only to restore non-solution flows/apps. If you deleted a flow/app that was part of a solution, you need to create a support ticket with Microsoft for assistance.
- Flows that have been deleted more than 28 days ago can’t be recovered, neither with PowerShell script nor Microsoft support
Conclution
- As part of Power Platform Release Plan Wave 1, This feature is introduced
- No need to raise a case with MS Power Platform Support Team to restore Flows/Apps
- Complete Information can be found from Microsoft Article
Improvment Idea
I personally feel, this option can be improved like the option which we have in SharePoint application (Recylce Bin). If you agree, feel free to Vote my submitted Idea in Power Platform Community just by hitting “vote” button form the below URL:
This was originally posted here.
*This post is locked for comments