You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/app-service-undelete.md
+34-7Lines changed: 34 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Restore deleted apps
3
3
description: Learn how to restore a deleted app in Azure App Service. Avoid the headache of an accidentally deleted app.
4
4
author: seligj95
5
5
ms.author: jordanselig
6
-
ms.date: 11/4/2022
6
+
ms.date: 4/3/2023
7
7
ms.topic: article
8
8
ms.custom: devx-track-azurepowershell
9
9
---
@@ -14,8 +14,8 @@ If you happened to accidentally delete your app in Azure App Service, you can re
14
14
15
15
> [!NOTE]
16
16
> - Deleted apps are purged from the system 30 days after the initial deletion. After an app is purged, it can't be recovered.
17
-
> - Undelete functionality isn't supported for the Consumption plan.
18
-
> -Apps Service apps running in an App Service Environment don't support snapshots. Therefore, undelete functionality and clone functionality aren't supported for App Service apps running in an App Service Environment.
17
+
> - Undelete functionality isn't supported for function apps hosted on the Consumption plan or Elastic Premium plan.
18
+
> -App Service apps running in an App Service Environment don't support snapshots. Therefore, undelete functionality and clone functionality aren't supported for App Service apps running in an App Service Environment.
19
19
>
20
20
21
21
## Re-register App Service resource provider
@@ -49,12 +49,12 @@ The detailed information includes:
49
49
## Restore deleted app
50
50
51
51
>[!NOTE]
52
-
>-`Restore-AzDeletedWebApp` isn't supported for function apps.
52
+
>-`Restore-AzDeletedWebApp` isn't supported for function apps hosted on the Consumption plan or Elastic Premium plan.
53
53
>- The Restore-AzDeletedWebApp cmdlet restores a deleted web app. The web app specified by TargetResourceGroupName, TargetName, and TargetSlot will be overwritten with the contents and settings of the deleted web app. If the target parameters are not specified, they will automatically be filled with the deleted web app's resource group, name, and slot. If the target web app does not exist, it will automatically be created in the app service plan specified by TargetAppServicePlanName.
54
54
>- By default `Restore-AzDeletedWebApp` will restore both your app configuration as well any content. If you want to only restore content, you use the **`-RestoreContentOnly`** flag with this commandlet.
55
55
56
56
57
-
Once the app you want to restore has been identified, you can restore it using `Restore-AzDeletedWebApp`, please see below examples
57
+
After identifying the app you want to restore, you can restore it using `Restore-AzDeletedWebApp`, as shown in the following examples.
58
58
>*You can find the full commandlet reference here: **[Restore-AzDeletedWebApp](/powershell/module/az.websites/restore-azdeletedwebapp)*** .
-**Target Resource Group**: Target resource group where the app will be restored
93
+
-**Target Resource Group**: Target resource group where the app is to be restored
94
94
-**TargetName**: Target app for the deleted app to be restored to
95
95
-**TargetAppServicePlanName**: App Service plan linked to the app
96
96
-**Name**: Name for the app, should be globally unique.
97
97
-**ResourceGroupName**: Original resource group for the deleted app
98
98
-**Slot**: Slot for the deleted app
99
-
-**RestoreContentOnly**: By default `Restore-AzDeletedWebApp`will restore both your app configuration as well any content. If you want to only restore content, you can use the `-RestoreContentOnly` flag with this commandlet.
99
+
-**RestoreContentOnly**: By default `Restore-AzDeletedWebApp`restores both your app configuration as well any content. If you want to only restore content, you can use the `-RestoreContentOnly` flag with this commandlet.
100
100
101
101
> [!NOTE]
102
102
> If the app was hosted on and then deleted from an App Service Environment, it can be restored only if the corresponding App Service Environment still exists.
103
103
104
+
## Restore deleted function app
105
+
106
+
If the function app was hosted on a **Dedicated app service plan**, it can be restored, as long as it was using the default App Service storage.
107
+
108
+
1. Fetch the DeletedSiteId of the app version you want to restore, using Get-AzDeletedWebApp cmdlet:
2. Create a new function app in a Dedicated plan. Refer to the instructions for [how to create an app in the portal](../azure-functions/functions-create-function-app-portal.md#create-a-function-app).
114
+
3. Restore to the newly created function app using this cmdlet:
Currently there's no support for Undelete (Restore-AzDeletedWebApp) Function app that's hosted in a Consumption plan or Elastic premium plan since the content resides on Azure Files in a Storage account. If you haven't 'hard' deleted that Azure Files storage account, or if the account exists and file shares haven't been deleted, then you may use the steps as workaround:
121
+
122
+
123
+
1. Create a new function app in a Consumption or Premium plan. Refer the instructions for [how to create an app in the portal](../azure-functions/functions-create-function-app-portal.md#create-a-function-app).
124
+
2. Set the following [app settings](../azure-functions/functions-how-to-use-azure-function-app-settings.md?tabs=portal#settings) to refer to the old storage account , which contains the content from the previous app.
125
+
126
+
| App Setting | Suggested value |
127
+
| ------------ | ---------------- |
128
+
|**AzureWebJobsStorage**| Connection String for the storage account used by the deleted app. |
129
+
|**WEBSITE_CONTENTAZUREFILECONNECTIONSTRING**| Connection String for the storage account used by the deleted app. |
130
+
|**WEBSITE_CONTENTSHARE**| File share on storage account used by the deleted app. |
0 commit comments