Losing data is stressful, and recovering a deleted Azure Storage Account can be a nightmare if you don't know what to do.
Azure Storage Account recovery is possible, but you need to act fast, as the Azure portal will automatically delete the account after 7 days.
You can recover a deleted Azure Storage Account by submitting a support request to Azure Support within 7 days of deletion.
Your Azure subscription details, including the subscription ID and account name, are crucial in the recovery process, so make sure to have them ready.
View and Manage
To view and manage your deleted storage account, navigate to the Azure portal and select "Resource groups" from the left-hand menu. This is where you'll find a list of all your resource groups, including those with deleted storage accounts.
You can filter the list by selecting "Deleted" from the dropdown menu at the top of the page. This will show you a list of all deleted storage accounts in your subscription.
From here, you can view the details of a deleted storage account by selecting it from the list. This will take you to a page with information about the account, including its name, type, and the date it was deleted.
To restore a deleted storage account, click on the "Restore" button at the top of the page. This will initiate the restore process, which can take a few minutes to complete.
Once the restore process is complete, you'll receive a confirmation email with a link to the restored storage account.
Recovery and Deletion
You can recover a deleted storage account in Azure within the recovery period, which is 14 days by default, but can be extended up to 90 days for general-purpose v2 storage accounts and up to 365 days for blob storage accounts.
To check the recovery period for a storage account, log in to the Azure portal, click on the Storage accounts menu item, click on the Deleted accounts tab, and check the status of the deleted storage account.
Discover more: Checking Onedrive Storage
The recovery period can be extended by enabling soft delete, which allows you to recover deleted blobs for up to 365 days.
Soft delete can be enabled on a storage account while creating it, by going to the Advanced tab, Data protection, and selecting Enabled.
Alternatively, soft delete can be enabled on an existing storage account by navigating to the DataProtection under Blob service, selecting Enabled, and entering the number of days you want to retain your soft deleted data.
To recover a deleted storage account, select the deleted storage account from the list of deleted accounts, click on the Restore button, review the details of the storage account, and click on the Restore button to start the recovery process.
Once the recovery process is complete, the restored storage account will appear in the list of storage accounts.
If you want to recover a deleted blob, click on the ellipsis of the deleted blob and select Undelete from the contextual menu.
You can also select the soft-deleted blob to view its properties, which shows the date and time when the blob was deleted and the number of days left until the blob is permanently deleted.
You might enjoy: Delete Loyal Fans Account
When versioning is enabled, you can restore a soft-deleted blob by selecting the soft-deleted blob, displaying its properties, selecting the Versions tab, selecting the version you want to promote, and selecting Make current version.
However, if the container or the storage account containing blobs is deleted, you will not be able to recover deleted files with soft delete feature being enabled, as everything will be deleted permanently.
To prevent accidental deletions of resources like storage account, containers, databases, etc. in Azure, it's a good practice to make use of Locks.
Here's a summary of the recovery and deletion process:
Delete Options and Configuration
You can enable soft delete in Azure Blob Storage to recover accidentally deleted data. By default, the feature is disabled, so you need to select Enabled and choose the number of days to retain soft deleted data.
To configure soft delete, navigate to your storage account and click DataProtection under Blob service. You can also enable it while creating a storage account by going to the Advanced tab, Data protection and selecting Enabled.
The soft delete feature works like a Recycle Bin or Trash, where deleted blobs are stored for a specified number of days before being permanently deleted. The maximum retention period is 365 days.
Related reading: What Is the Data Storage in Azure Called
Account Deletion Reasons
When you're considering deleting a storage account in Azure, it's essential to understand the reasons behind the decision.
The storage account is no longer required. This is a common reason for deletion, especially if you've upgraded to a new storage solution or no longer need the storage capacity.
The storage account is not compliant with organizational policies. This can be due to various reasons such as data retention, security, or compliance regulations.
The storage account contains sensitive data that needs to be deleted. This is a serious reason for deletion, as sensitive data can pose a significant risk if it falls into the wrong hands.
Accidental deletion by a user is another reason for deleting a storage account. This can happen due to human error or a misconfigured workflow.
Here are some of the common reasons for deleting a storage account in Azure:
- The storage account is no longer required.
- The storage account is not compliant with organizational policies.
- The storage account contains sensitive data that needs to be deleted.
- Accidental deletion by a user.
Configuring Delete
Soft delete feature is not enabled by default on a storage account. You will need to enable this feature and configure it.
To enable soft delete, go to your storage account, click on DataProtection under Blob service, and select Enabled. You can also specify the number of days you want to retain your soft deleted data.
You can configure soft delete while creating a storage account by going to the Advanced tab, Data protection, and selecting Enabled.
To configure soft delete, you can use the DeleteRetentionPolicy class and call SetServiceProperties on the BlobClient. For example, you can specify to retain deleted blobs for 10 days.
Soft delete can be used to recover deleted blob snapshots as well. To do this, you need to enable soft delete and then create a snapshot of the blob. If the snapshot gets deleted, you can recover it using soft delete.
Here's a summary of the steps to configure soft delete:
- Enable soft delete on your storage account
- Specify the number of days to retain soft deleted data
- Use the DeleteRetentionPolicy class to configure soft delete
- Create a snapshot of the blob to recover deleted snapshots
Note: Soft delete does not help recover deleted storage accounts or containers. If you delete a storage account or container, all data, including soft-deleted blobs, will be permanently deleted.
A fresh viewpoint: Delete Copied Link
Managing Storage Account
Restoring a deleted storage account is a straightforward process. You can restore a deleted storage account by selecting it from the list of deleted accounts and clicking on the Restore button at the top of the page.
In the Restore Account pane, review the details of the storage account, such as the account name, type, and location. This ensures you're restoring the correct account.
To start the recovery process, click on the Restore button. The restored storage account will then appear in the list of storage accounts once the recovery process is complete.
Manage Directories
In the Azure portal, you can view and manage soft-deleted directories in accounts with a hierarchical namespace.
To view soft-deleted directories, navigate to the Overview page for the container and toggle the Show deleted blobs setting. This will display soft-deleted directories with a status of Deleted.
However, soft-deleted directories might not appear if your security principal relies only on access control list (ACL) entries for authorization. You must either be the owner of the account or have the role of Storage Blob Data Owner, Storage Blob Data Contributor, or Storage Blob Data Reader to view them.
A different take: Which Azure Storage Service Supports Big Data Analytics
If you rename a directory that contains soft-deleted items, those items become disconnected from the directory. To view them, you'll have to revert the name of the directory back to its original name or create a separate directory that uses the original directory name.
You can display the properties of a soft-deleted directory by selecting it from the list. Under the Overview tab, notice that the status is set to Deleted. The portal also displays the number of days until the directory is permanently deleted.
To restore a soft-deleted directory, first display the directory's properties, then select the Undelete button on the Overview tab.
If you want to restore soft-deleted items that are disconnected from a directory, you'll have to revert the name of the directory back to its original name or create a separate directory that uses the original directory name.
Here are the steps to restore a soft-deleted directory using PowerShell:
1. Ensure you have the Az.Storage preview module installed.
2. Obtain storage account authorization by using a storage account key, a connection string, or Microsoft Entra ID.
3. Use the Restore-AzDataLakeGen2DeletedItem command to restore the soft-deleted directory.
Similarly, you can restore a soft-deleted directory using Azure CLI:
1. Make sure you have the storage-preview extension installed.
2. Get a list of deleted items using the az storage fs list-deleted-path command.
3. Use the az storage fs undelete-path command to restore the soft-deleted directory.
For another approach, see: Azure Create Storage Account
View Snapshots
Viewing snapshots is an essential part of managing your storage account, and it's easier than you think.
You can view snapshots associated with a blob by displaying the soft-deleted blob's properties and navigating to the Snapshots tab.
Deleted snapshots can be displayed in the Azure portal, and they can be shown by toggling the "Show deleted snapshots" option.
Soft-deleted blobs also come with snapshots, and if you delete a blob, its associated snapshots will also be deleted.
To view deleted snapshots, you'll need to display the soft-deleted blob's properties and navigate to the Snapshots tab, then toggle "Show deleted snapshots".
This feature is particularly useful if you're trying to recover a deleted blob or snapshot and want to see what's available for restoration.
Restoring a soft-deleted version is slightly different if blob versioning is also enabled for your storage account, so be sure to check the documentation for more information.
Backup File
When you delete a backup file from Azure Blob Storage, you can still retrieve it by clicking on "Undelete". This will allow you to view the backup file that was deleted.
Consider reading: Azure File Storage vs Blob
You can restore a deleted backup file from Azure Blob Storage. This is a useful feature to have, especially if you accidentally deleted an important file.
SQL Server is a database management system that allows you to store and manage large amounts of data. It's a powerful tool that's widely used in many industries.
If you have multiple rows of data in SQL Server and want to combine them into a single row and column, you can use a rolling up function. This can be a huge time-saver, especially if you have a lot of data to work with.
You can also use SQL Server to retrieve your database backup history and check if you have any backups available. This can be a lifesaver if you need to restore your database to a previous state.
Consider reading: Azure Cli Upload File to Blob Storage
Sources
- Manage and restore soft-deleted blobs - Azure Storage (microsoft.com)
- How to Recover a Deleted Storage Account (smikar.com)
- How to recover accidental deletes in Azure Blob Storage (sqlshack.com)
- Azure Soft Delete Option for Blob Storage to Recover ... (mssqltips.com)
- Oops! I Deleted My Blobs! What Can I Do? - GauravMantri.com (gauravmantri.com)
Featured Images: pexels.com