Do not take into account soft delete for blobs - azure

I have a Azure Storage Account and I have enabled soft delete for blobs.
Is is possible to call instant deletion (ignore the soft deletion period) for some specific blobs?
I am using Azure.Storage.Blob v12.7.0, but DeleteBlobIfExistsAsync or DeleteAsync have no extra parameters that I can use.

Unfortunately at the moment there is no built-in feature to permanent delete blobs with enabled soft-delete option (ignore the soft deletion period).
https://feedback.azure.com/forums/217298-storage/suggestions/35076274-permanent-deletion-of-soft-deleted-blobs-gdpr
There is a workaround:
Disable the soft-deleted option.
Select the Blob Containers via Microsoft Azure Storage Explorer, choose Active and deleted blobs.
Undelete the deleted blobs and then remove it again
Then blob is permanently deleted
This approach is described here
https://github.com/MicrosoftDocs/azure-docs/issues/13064
You can automate the above workaround with Azure.Storage.Blob v12.7.0

Related

Azure Operational Backup for Azure Blobs different from soft delete?

I have enabled soft delete for blobs, containers as well as point in time restore on my storage account. If I delete my blobs, container or even the entire storage account, it can still be restored it seems. So what does the new Operational Backup for Azure Blobs actually add?
https://learn.microsoft.com/en-us/azure/backup/blob-backup-overview
https://learn.microsoft.com/en-us/azure/storage/blobs/soft-delete-blob-overview
Soft delete protection is limited than Operational back up and has to enable additional settings in
order for additional protection.
But it is useful when only individual blobs are to be protected
instead of storage account level protection.
As You can use blob soft delete only to restore an individual blob,
snapshot, directory (in a hierarchical namespace) or version. To
restore a container and its contents, container soft delete must also
be enabled for the storage account.
Operational backup is configured and managed at the storage account level, and applies to all block blobs within the storage
account and uses a backup policy and can select to store multiple
storage accounts at a time or Select containers or Selected prefix
matches to restore a subset of blobs.
It does the Continuous back up instead of x no of back ups i.e;
you don’t need to schedule any backups and is stored within the
storage account local back up.
Operational backup prevents the blobs from deleting and overwriting as it enforces delete locks on protected blobs and also backs up even if it is not deleted where as soft delete doesn’t stop from deletion but the blobs deleted can be restored and retained it till a period of time .
Data loss is less in Operational back up as Blob point-in-time restore allows restoring blob data to an earlier state. This, in turn, uses soft delete, change feed and blob versioning to retain data for the **specified duration**.
Blob soft delete The clock starts on the retention period as soon as an object is deleted or overwritten .So you can restore a soft-deleted object to its state only at the time it was deleted.
Soft delete does not afford overwrite protection for blobs in the
archive tier. Versioning is not supported for accounts that have a
hierarchical namespace.
For the blobs whose operational back up is enabled and has already soft delete enabled has its back up for extra 5 days if retention policy of op backup is less than soft delete time.Else it will remain unchanged.
Soft delete allows to undelete the blob before restore time after it is deleted or overwritten. Where as operational back up doesn’t allow deletion itself and monitoring is possible with central back up store management.
Note: Operational backup supports operations on block blobs only and
operations on containers can’t be restored. If you delete a container
from the storage account by calling the Delete Container operation,
that container can’t be restored with a restore operation. It’s
suggested you enable soft delete to enhance data protection and
recovery.
So soft delete can be used for minor protection for blob level with selective versioning changes and additional container protection where as operational backup is all together in single pack with extra protection which restores the version ,overwrites or deletion at whatever time you set it .

How to disable snapshot in Azure Storage?

Snapshots cause a lot of cost. In some of my storage accounts I don't need them.
But I can't find a place where I can turn it off.
How can I disable snapshots completely from a storage account in Azure?
It's not a feature that can be turned off completely; Although to make snapshots you would have to explicitly write code to create them, unless you have soft delete enabled. In that case an overwrite will create a snapshot in deleted state but it'll be automatically removed once the soft delete time expires.
Another option would be the lifecycle management. There you can make a rule to automatically delete snapshots once they are more than X days old. That check runs daily so the storage costs are only extended by a few days.
Navigate to your storage account's blob and look for your snapshots under Snapshots. From there, you may manage them.
https://i.imgur.com/P2LRras.png
If you've already established a resource for it, go to that resource's page and delete it.
https://i.imgur.com/qLvFe3v.png

Does azure storage folder supports disabling/restricting the ability to delete a folder

Does azure storage folder supports disabling/restricting the ability to delete a folder in a container. If no, how to trigger an event off deletion that will automatically recreate the folder.
1.Azure Blob storage does not have concept of folders. everything inside the container is considered a blob including the folders.
The hierarchy is storage account>>container>>blob. Removing a particular folder is removing all the blobs which start with the folder name.
2.You can use custom RBAC roles to "Restrict user from upload or delete operation on Storage” Restrict user to delete blob
We have few options available for end-to-end protection for blobs
Container soft delete, to restore a container that has been deleted.
Blob versioning, to automatically maintain previous versions of a blob. When blob versioning is enabled, you can restore an earlier version of a blob to recover your data if it is erroneously modified or deleted
Blob soft delete, to restore a blob or version that has been deleted

How can I delete a leased blob in Microsoft Azure storage

I created a virtual machine in Azure and then deleted it.
However, the associated storage account still exists.
I can't delete the storage account because it contains a container with a blob in it that has an indefinite lease.
Nothing else is using this storage account.
How can I delete this blob?
You need to delete the disk objects that are associated with the abandoned vhd's. You can do this easily in either the classic or new portal. Once you dispose of these (along with associated leases), you should be able to get rid of your storage account
In the Classic portal (manage.windowsazure.com), you just visit Virtual Machines, then Disks. Select a disk to delete, and click the trash can at the bottom of the screen.
In the new portal (portal.azure.com) you'll find the disks under OS Disks (classic) :
From there, you can select and delete the disks from the VM's you deleted.
You can Use Azure Cloud Explorer tool on Codeplex Open the Storage Account Delete all files inside that container,
Then you Can Delete the Container and the Storage Account Easily
One solution is to delete the container, whether through a GUI like a cloud explorer, tooling like Azure Storage Powershell, or using the rest API with an Azure Storage Client Library.
You don't need the blob lease to delete the container, which would also delete any blobs present in the container.

Azure Storage & Snapshots

I have a VHD in a container which was mounted by an instance (a DotNetNuke accelerator). But now the instance is stopped so the VHD is not mounted anymore.
The problem is I can't rename this VHD with any UI client. "CloudBerry Explorer for Azure Blob Storage" shows an error when I try to rename it of
This operation is not permitted because the blob has snapshots.
I tried to list snapshots in VisualStudio but it only returns the blob's name...
I tried to mount the VHD in an instance and create a file and it works!?
I'm going crazy. :)
I've managed to remove blob which has snapshots by using Microsoft Azure Storage Explorer. Steps are:
You navigate to the blob in question
Right click -> Manage Snapshots
Delete all the snapshots and the blob will disappear also
The error is accurate. If you get that, it means the blob actually has snapshots. When you mount a blob you are most likely mounting the current version and not a past snapshot. You can enumerate the snapshots using the REST API (use the 'include=snapshots option) to prove this to yourself.
If you really want to delete the blob with minimal hassle, I would suggest using https://www.myazurestorage.com (safe site from Microsoft DPE). It will enumerate your snapshots automatically and allow you to delete them. Once they are all deleted, you can also delete the blob.

Resources