Hello Thomas Mueller,
Welcome to Microsoft Q&A Forum. Thanks for posting your query here!
I understand that you would like to know if deleting the container have the same cost as just deleting the blobs
Please be informed that deleting a container in Azure Blob Storage that has "Container soft delete" disabled will result in the permanent deletion of the container and its contents, meaning you will not incur storage costs for the deleted container or its blobs after deletion.
However, if "Blob soft delete" is enabled for your account, the blobs will remain in a soft-deleted state for the duration of the retention period (14 days in your case), which means you will still incur storage costs for those soft-deleted blobs during that time.
In your scenario, if you delete a container, you will not have to pay for the storage of that container anymore, but you will still incur costs for the soft-deleted blobs for the retention period. Therefore, while deleting the container may reduce costs associated with the container itself, the costs for the blobs will still apply until the retention period expires.
We recommend you adhere to the steps outlined below to refined solution and considerations:
- Upload your large blobs to Container A.
- After 6 hours Delete all blobs from Container A. Use the Azure CLI, PowerShell, or the Azure Storage SDK to efficiently delete all blobs within the container.
- Switch container to B and Start uploading new blobs to Container B.
- After 6 Hours (in Container B) Delete all blobs from Container B and Switch back to Container A.
You can also Create an Azure Function triggered by a timer (e.g., every 6 hours) to automate the deletion process. This provides a reliable and scalable solution and alternatively, use Azure Logic Apps to orchestrate the container switching and deletion process.
Answer for your question
Yes, deleting the container will result in significant cost savings compared to simply deleting the individual blobs, especially with a 14-day soft delete period. This is because you immediately reclaim the storage space and eliminate the costs associated with storing soft-deleted blobs for those 14 days. During this period, you are still charged for the storage space occupied by these soft-deleted blobs. Deleting the container permanently removes all blobs within it, including those in the soft-deleted state. This immediately frees up the storage space and eliminates the associated storage costs for those 14 days.
While the exact cost savings will vary based on your storage account type, usage patterns, and pricing tier, deleting the container generally results in substantial cost savings. You immediately reclaim the storage space consumed by the deleted blobs and their soft-deleted copies, avoiding those costs for the entire soft delete period.
Additional information: Documentation on Soft delete for Blob storage - Pricing and billing :
https://learn.microsoft.com/en-us/azure/storage/blobs/soft-delete-blob-overview#pricing-and-billing
Please let us know you have any further quires. We are here at your service and will be glad to assist you closely.