Skip to content
Advertisement

list and restore soft deleted blobs – azure python

I need to restore multiple blobs in my container.The storage account was enabled with soft delete for 10 days. I see here on how to undelete , but I have multiple blobs recursively within directories which are soft deleted

However I failed to find here via python.

I need to do it in python to list and undelete the blobs

Advertisement

Answer

Surely, you could find sdk method in Python Storage SDK corresponding to the REST API.

from azure.storage.blob.baseblobservice import (
    BaseBlobService
)

accountName = "***"
accountKey = "***"
containerName = "***"
blobName = "***"

blobService = BaseBlobService(account_name=accountName, account_key=accountKey)

blobService.undelete_blob(containerName, blobName)
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement