Reputation: 27
I have a csv which is under a container in Azure Storage. I tried all the ways mentioned online to delete it but its not getting delete. I was able to delete all the data from the same but the csv file still remains. Also, lease state shows broken. Can someone guide for any way to do the same?
I tried to delete the folder which contains this file. That's also not happening.
As per some suggestions, I tried to delete the blob from Azure storage explorer as well, but it didn't delete.
I have tried deleting the blob using below code but its not happening -
var blobContainerName = Environment.GetEnvironmentVariable("ContainerName");
var blobConnectionString = Environment.GetEnvironmentVariable("BlobConnectionString");
var blobClientOptions = new BlobClientOptions()
{
Retry = { MaxDelay=TimeSpan.FromMinutes(5), NetworkTimeout = TimeSpan.FromHours(5) }
};
var container = new BlobContainerClient(blobConnectionString, blobContainerName, blobClientOptions);
using (var blob = container.GetBlobClient(fileName).Download().Value)
await container.GetBlockBlobClient(fileName).DeleteIfExistsAsync();
The error that I am getting everywhere is -
\[2024-06-05T07:29:16.736Z\] ErrorCode: OperationTimedOut
\[2024-06-05T07:29:16.690Z\] Timeout value of 00:30:00 exceeded by function 'BlobToSnowFlakeFunction' (Id: '4449572f-51ae-4139-90d1-43a1e67dc03a'). Initiating cancellation.**```
Upvotes: 1
Views: 148
Reputation: 10370
Blob under Azure container not getting delete
The above condition maybe the blob has enabled policy like immutable policy like time-based retention or legal hold policy.
Portal:
In this period, In WORM state, data can't be modified or deleted for a user-specified interval.
Another there maybe snapshots, you can delete the blob with snapshots using below azure cli command.
Command:
az storage blob delete --account-name <storage-account-name> --account-key <storage-account-key> --container-name <container-name> --name <blob-name> --delete-snapshots include
This will delete a blob, all of its snapshots must also be deleted. Both can be removed at the same time.
Reference:
Upvotes: 0