Public preview: Undelete for App Service
Published date: September 24, 2018
The undelete feature in Azure App Service is now in public preview. Undelete is available for all App Service plans. Only sites deleted in the past 30 days can be restored.
A user can undelete a deleted web app and restore the following:
- The content of the deleted app.
- The configuration of the app. (The commands allow you to skip the restoration of the app configuration.)
- The *.azurewebsites.net host name, if it’s still available.
Currently, the undelete commands support the restoration of apps deleted from multiple tenants that use Windows and Linux.
To get started, install the PowerShell module or install the Azure CLI. You can then do the following.
List deleted apps
In the Azure CLI, you can list deleted apps by using the following command. Use the optional parameters to filter the apps that have a specific name, or that belong to a specific resource group or App Service plan. Record the ID of the deleted site, because that will be used to restore the app.
az webapp deleted list --name <name of the deleted app>
Restore a deleted app
In the Azure CLI, you need to have an existing app or an app slot to restore your app to:
Get-AzureRmDeletedWebApp -name <name of the deleted app>
In PowerShell, you can specify the name and resource group of the deleted app, and provide the information of the target app. You can specify an App Service plan name to restore to, and the command will try to restore the app with the same *.azurewebsites.net hostname as the deleted app.
Restore-AzureRmDeletedWebApp -ResourceGroupName <deleted app rg> -Name <deleted app name> -TargetAppServicePlanName <App Service plan name to create an app to restore to>