Skip to content

Commit e6e082c

Browse files
committed
Update app-service-undelete.md
Updating function app content, calling out supported and unsupported scenarios. Merging specific content from https://techcommunity.microsoft.com/t5/apps-on-azure-blog/restore-undelete-deleted-web-apps/ba-p/2922088 for better discoverability
1 parent 8cbbaa8 commit e6e082c

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

articles/app-service/app-service-undelete.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Restore deleted apps
33
description: Learn how to restore a deleted app in Azure App Service. Avoid the headache of an accidentally deleted app.
44
author: seligj95
55
ms.author: jordanselig
6-
ms.date: 11/4/2022
6+
ms.date: 4/3/2023
77
ms.topic: article
88
ms.custom: devx-track-azurepowershell
99
---
@@ -14,7 +14,7 @@ If you happened to accidentally delete your app in Azure App Service, you can re
1414

1515
> [!NOTE]
1616
> - 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.
17+
> - Undelete functionality isn't supported for function apps hosted on the Consumption plan or Elastic Premium plan.
1818
> - 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.
1919
>
2020
@@ -49,7 +49,7 @@ The detailed information includes:
4949
## Restore deleted app
5050

5151
>[!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.
5353
>- 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.
5454
>- 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.
5555
@@ -101,5 +101,32 @@ The inputs for command are:
101101
> [!NOTE]
102102
> 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.
103103
104+
## Restore deleted function app
105+
106+
If the Function App was hosted on **Dedicated app service plan**, then we have a way to restore it, if it was using default app service storage.
107+
108+
1. Fetch the DeletedSiteId of the app version you want to restore, using Get-AzDeletedWebApp cmdlet:
109+
110+
```powershell
111+
Get-AzDeletedWebApp -ResourceGroupName <RGofDeletedApp> -Name <NameofApp>
112+
```
113+
2. Create a new function app on Dedicated plan. Check out the instructions for [how to create on 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:
115+
116+
```powershell
117+
Restore-AzDeletedWebApp -ResourceGroupName <RGofnewapp> -Name <newApp> -deletedId "/subscriptions/xxxx/providers/Microsoft.Web/locations/xxxx/deletedSites/xxxx"
118+
```
119+
120+
Currently there is no support for Undelete (Restore-AzDeletedWebApp) Function Apps that are hosted on Consumption plan or Elastic premium plan. These are the scenarios where content resides on Azure Files on a Storage account. If you have not 'hard' deleted the Azure files storage account or if it exists and has not been deleted, then you may use the steps below as workaround:
121+
122+
123+
1. Create a new function app on Consumption or Premium plan. Check out the instructions for [how to create on 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 for the app content.
125+
126+
| App Setting | Suggested value |
127+
| ------------ | ---------------- |
128+
| **AzureWebJobsStorage** | Connection String for storage account of deleted site |
129+
| **WEBSITE_CONTENTAZUREFILECONNECTIONSTRING** | Connection String for storage account of deleted site |
130+
| **WEBSITE_CONTENTSHARE** | File share on storage account of deleted site |
104131

105132

0 commit comments

Comments
 (0)