blobazure-blob-storagetextblob

How to prevent deletion of a blob?


Is it possible to make a particular blob non delete able? If so, how? I want one blob to stay forever and no one should be able to delete that.


Solution

  • Solution 1:

    Try with making the blob immutable

    Immutable storage for Azure Blob Storage enables users to store business-critical data in a WORM (Write Once, Read Many) state. While in a WORM state, data cannot be modified or deleted for a user-specified interval. By configuring immutability policies for blob data, you can protect your data from overwrites and deletes.

    immutable storage for Azure Blob storage supports two types of immutability policies

    1) Time-based retention policies: the time-based retention policy, users can set policies to store data for a specified interval. When a time-based retention policy is set, objects can be created and read, but not modified or deleted. After the retention period has expired, objects can be deleted but not overwritten. For more details about time-based retention policies, Refer Time-based retention policies for immutable blob data

    2) Legal hold policies: A legal hold stores immutable data until the legal hold is explicitly cleared. When a legal hold is set, objects can be created and read, but not modified or deleted. For more details refer Legal holds for immutable blob data.

    For more details refer this document

    Solution 2:

    Use the RABC to secure access to containers .

    Solution 3:

    Use Blob soft delete

    individual blob and its versions, snapshots, and metadata from accidental deletes or overwrites by maintaining the deleted data in the system for a specified period of time

    For more details refer this document