Recovering a Deleted Power App

Introduction

Losing a Power App can be frustrating, especially if it contains critical functionality. Fortunately, there are ways to restore deleted apps. In this guide, we’ll walk through the process step by step.


Check Your Admin Status:

  • Ensure you have Environment Admin privileges for the environment where the app was deleted.
  • If you’re unsure, verify your admin status or find someone who has these permissions.

Open Windows PowerShell:


  • Open the Start Menu.
  • Type “Windows PowerShell” in the search bar.
  • Right-click the “Windows PowerShell” app in the search results.
  • Select “Run as Administrator".




    Import the Necessary Modules
    :

    • In the PowerShell window, enter the following commands to install the required modules:

      Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
      Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber
    • If you don’t have admin rights on your computer, use the -Scope CurrentUser parameter for installation:

      Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Scope CurrentUser
      Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber -Scope CurrentUser


      If prompted, type A to accept all


    Use PowerShell to List Deleted Apps:

    Log in to the Power Apps environment using:

    Add-PowerAppsAccount

    If you receive the following error:


    Type the following command and try again:

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
    dir . | Unblock-File



    Retrieve the list of deleted apps with:

    Get-AdminDeletedPowerAppsList -EnvironmentName <EnvironmentId>

    You can find the Environment Id from the make.powerapps.com url after the "environments/":





    Recover the Deleted App:
    • Identify the app you want to restore from the list and copy its appId and environmentId from the retrieved deleted apps list:


    • Use the following to restore the app, replacing <AppId> with the actual app ID and <EnvironmentId> with the actual Environment Id.

    1. Get-AdminRecoverDeletedPowerApp -EnvironmentName <EnvironmentId> -AppName <AppId>


    You have now successfully restored your app. At this stage, we can return to the Maker Portal and the app that we restored should appear in the app list. The name of the app will be suffixed with a description that indicates the restoration date.

    Raise a Support Ticket (if needed):
    • If PowerShell doesn’t list your deleted apps or you encounter issues, consider raising a support ticket with Microsoft.
    • Visit the Power Apps support page and click “Create support ticket.”


    Remember to back up your apps periodically to avoid such situations in the future! 🌟

    For more detailed instructions, you can refer to this blog post. If you encounter any difficulties, Microsoft support may be able to assist you in recovering your app. Good luck! 😊🚀

     

    Comments