newly created folder in the container is automatically deleted

Oleg Yurchenko 20 Reputation points
2024-08-21T15:35:54.94+00:00

An external application uses container key to access the Azure blob standard v2 container to create a new folder, and it is immediately deleted. I need to Undelete to view the folder. How can I avoid this automated deletion?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,918 questions
{count} votes

Accepted answer
  1. Nehruji R 8,146 Reputation points Microsoft Vendor
    2024-08-22T10:40:40.9733333+00:00

    Hello Oleg Yurchenko,

    Greetings! Welcome to Microsoft Q&A Platform.

    If a container in azure blob storage deleted automatically after creating that suggests a misconfiguration or an automated issue. Here are some steps to solve the issue.

    To undelete and view the folder that was automatically deleted in your Azure Blob Storage please check the following methods,

    1. Check life cycle management policy:
    • Navigate to the azure portal >storage accounts > containers.
    • Select the container or check under Lifecycle Management.
    • Ensure that there are no lifecycle management policies set to delete blobs immediately after creation. 2.Enable soft delete:
    • Make sure that soft delete is enable so that you can recover if they are deleted.
    • Navigate to the azure portal > storage accounts > data protection
    • under settings enable soft deletion. 3.Check the access policies and permissions associated with the container keys
    • Enable Azure Monitor and Azure Activity Logs to track and audit operations on your storage account.
    • Set up alerts to notify you about creation or deletion events. This can help you identify when and why the container is being deleted. 4.To restore a soft-deleted blob, you can use the Azure portal.
    • Navigate to containers > Go to show delete blob settings to view soft delete blobs then select the delete blob and select undelete.

    To prevent the deletion of blobs in your Azure Storage account, you can use several features and configurations as Azure Storage provides data protection for Blob Storage and Azure Data Lake Storage Gen2 to help you to prepare for scenarios where you need to recover data that has been deleted or overwritten.

    If you're looking for basic data protection coverage for your storage account and the data that it contains, then Microsoft recommends taking the following steps to begin with:

    • Configure an Azure Resource Manager lock on the storage account to protect the account from deletion or configuration changes. Learn more...
    • Enable container soft delete for the storage account to recover a deleted container and its contents. Learn more...
    • Save the state of a blob at regular intervals:
      • For Blob Storage workloads, enable blob versioning to automatically save the state of your data each time a blob is overwritten. Learn more...
      • For Azure Data Lake Storage workloads, take manual snapshots to save the state of your data at a particular point in time. Learn more...

    These options, as well as other data protection options for other scenarios, are described in more detail in the following doc - https://video2.skills-academy.com/en-us/azure/storage/blobs/data-protection-overview.

    Hope this answer helps! Please let us know if you have any further queries. I’m happy to assist you further.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Michael Taylor 54,806 Reputation points
    2024-08-21T15:43:13.7233333+00:00

    Blob storage doesn't have "folders". A storage container is nothing more than a collection of blobs. A blob is a binary set of data, aka a file. It is not a file system nor does it support "folders". What you see as a folder in a container is just a blob that happens to be named folder/name. In UX's that are aware, they will show you the container contents in a folder-like structure but under the hood it is a just a set of blob files sitting in the container. Hence you cannot have an empty folder since an empty folder means there are no files and therefore no blobs.

    Given your description, you cannot create a new folder. I assume the app is creating a blob (a file) using a naming convention that includes a / such that the UX shows you a folder structure. You cannot undelete a folder but you can undelete a blob (file).

    Please provide more details on exactly what the app is doing including the blob it is created. Include any relevant code that you might be using. Also check any policies you may have on the storage container (such as archiving) to see if anything may be getting in the way.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.