Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » AWS/Azure/OpenShift » How to Restore Deleted Azure App Service Using PowerShell
  • FEAUREanydesk
    How to install AnyDesk on a Linux Machine Linux
  • Distributed File System DFS
    All About Distributed File System Windows
  • DC creation as recommended by Microsoft
    Setup a Domain Controller as Recommended by Microsoft Windows Server
  • unknown error has occured
    Unknown Error occurred when installing Veeam Software Appliance Backup
  • Screenshot 2020 11 17 at 02.06.58
    The PA Server Monitor review and product details Reviews
  • xvy
    Fix Error 0xc1420127: The specified image in the specified wim is already mounted for read and write access Windows Server
  • We cannot fine camera
    Fix we could not find a camera compatible with Windows Hello Face Windows
  • posfix as an smtp server
    How to Install and Configure Postfix as a Send-Only SMTP Server Linux

How to Restore Deleted Azure App Service Using PowerShell

Posted on 27/03/202428/03/2024 Imoh Etuk By Imoh Etuk No Comments on How to Restore Deleted Azure App Service Using PowerShell
Azure-App-Service

In this post, I will briefly take you through how to Restore Deleted Azure App Service Using PowerShell. Before I proceed, let’s talk about Azure App service in detail. Azure App Service is a managed platform created by Microsoft for hosting web applications, mobile backends, and RESTful APIs. You can easily deploy WordPress on Azure App Service. You also use Azure CLI to create App Service and deploy your Angular App to Azure from Visual Studio Code with ease using App Service.

It falls under the category of Platform as a Service (PaaS) which means you get to focus on developing your application while Microsoft takes care of the underlying infrastructure like servers, operating systems, and networking.

App Service offers you the platform to host your apps in multiple languages and frameworks. You can develop your web applications or APIs using various programming languages like .NET, .NET Core, Java, Python, PHP, Ruby, or Node.js and bring it to run on App Service.

The important things to note are: Firstly, deleted apps are purged from the system 30 days after the initial deletion. After an app is purged, it can't be recovered. 

Secondly, you cannot restore function apps hosted on the Consumption plan or Elastic Premium plan.

Thirdly, App Service apps running in an App Service Environment don't support snapshots. Therefore, undelete functionality and clone functionality are nott supported for App Service apps running in an App Service Environment.

See also how to create an App Service Plan with Continuous Deployment to deploy a .NET Application from GitHub.

Prerequisites

To follow along in this post, you must have the following:

  1. Azure Subscription with the contributor access to create and manage an App Service
  2. App Service Plan
  3. Deleted App Service
  4. PowerShell running on your Windows Machine.

Restoring Deleted App Service Using PowerShell

If you have met the above-mentioned prerequisites, let’s proceed to carry out the demonstration.

To start with, let me inspect the existing app service that I have currently running in my environment. The name is to tobedeleted001 deployed into the resource group called TobeDeleted-RG in the East US location.

App-Service-to-be-deleted
Fig 1- Showing an App Service in a running state
It is important to remember the current name of the App Service, Resource Group Name and Location. These information are required to restore deleted App Service.

I will proceed to delete this App Service and then take us through the process of restoring it using PowerShell.

Deleting-App-Service
Fig 2 – Deleting App Service

To restore App Service follow the steps below:

Step 1: Launch the PowerShell on your computer

In the PowerShell screen, run below commands:

$Connect-AZAccount  - To authenticate to Your Azure Account
$Set-AzureSubscription -SubscriptionId 'XXXX-XXXXX-XXXXXXX-XXXX' - To select your preferred subscription if you have more than one Azure Subscriptions.
Authenticating-to-Azure-Account
Fig 3 – Authenticating to Azure Account

Step 2 – Discover deleted App Service

To get started with restoring a deleted App Service, you need to run the command below to discover some details about your deleted App Service. Such details include:

Get-AzDeletedWebApp -Name <your_deleted_app> -Location <your_deleted_app_location> 
Discovering-Deleted-App-Service
Fig 4 – Discovering Delete App Service

The above screenshot gives you detailed information includes:

Id: Showing the Subscription and the resource provider
DeletedSiteId: Unique identifier for the app, used for scenarios where multiple apps with the same name have been deleted
SubscriptionID: Subscription containing the deleted resource
Location: Location of the original app
ResourceGroupName: Name of the original resource group
Name: Name of the original app.
Slot: the name of the slot. In this case, Production.
Deletion Time: The date and time when the app was deleted

Step 3: Restore deleted app

To restore deleted App Service, run the below command:

Restore-AzDeletedWebApp -TargetResourceGroupName -Name -TargetAppServicePlanName
Restoring-Deleted-App-Service
Fig 5 – Restoring Deleted App Service

As shown in the above screenshot, when prompted for confirmation, type Y and press Enter to proceed.

App-Service-Restored
Fig 6 – Deleted App Service Restored

I hope you found this guide on how to restore deleted Azure App Service using PowerShell very useful. Please feel free to leave a comment below.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Pocket (Opens in new window) Pocket
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Automation, AWS/Azure/OpenShift, Scripts Tags:Azure CLI, PowerShell, PowerShell Cmdlet, Resource Group

Post navigation

Previous Post: Manage BitLocker and FileVault with Trellix Native Encryption
Next Post: How to Test Web Applications Using Scandium

Related Posts

  • EC2
    How to Add and Format a New Virtual Disk to an EC2 Instance AWS/Azure/OpenShift
  • azure resource groups 1
    Setup Public Load Balancer in Azure AWS/Azure/OpenShift
  • 7164 1024x575 1
    How to install MDT PowerShell module on Windows Scripts
  • CreateanAWSact
    How to Set up an Amazon Web Services (AWS) Account AWS/Azure/OpenShift
  • banner
    How to Integrate TestRail with Cypress Automation
  • image 190
    Creating Profiles for your AWS Access Credentials for AWS Toolkit in Visual Studio AWS/Azure/OpenShift

More Related Articles

EC2 How to Add and Format a New Virtual Disk to an EC2 Instance AWS/Azure/OpenShift
azure resource groups 1 Setup Public Load Balancer in Azure AWS/Azure/OpenShift
7164 1024x575 1 How to install MDT PowerShell module on Windows Scripts
CreateanAWSact How to Set up an Amazon Web Services (AWS) Account AWS/Azure/OpenShift
banner How to Integrate TestRail with Cypress Automation
image 190 Creating Profiles for your AWS Access Credentials for AWS Toolkit in Visual Studio AWS/Azure/OpenShift

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • FEAUREanydesk
    How to install AnyDesk on a Linux Machine Linux
  • Distributed File System DFS
    All About Distributed File System Windows
  • DC creation as recommended by Microsoft
    Setup a Domain Controller as Recommended by Microsoft Windows Server
  • unknown error has occured
    Unknown Error occurred when installing Veeam Software Appliance Backup
  • Screenshot 2020 11 17 at 02.06.58
    The PA Server Monitor review and product details Reviews
  • xvy
    Fix Error 0xc1420127: The specified image in the specified wim is already mounted for read and write access Windows Server
  • We cannot fine camera
    Fix we could not find a camera compatible with Windows Hello Face Windows
  • posfix as an smtp server
    How to Install and Configure Postfix as a Send-Only SMTP Server Linux

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,832 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.