delete_blob Method
Deletes a blob.
Syntax
def delete_blob(blob: str, delete_action: int) -> None: ...
Remarks
This method deletes the specified Blob in the container currently selected by container. DeleteAction specifies how the delete operation should be handled; possible values are:
Single (0) | Only delete the specified blob. The request will fail if any snapshots of the blob exist. |
Snapshots Only (1) | Delete all of the specified blob's snapshots, but not the blob itself. |
Everything (2) | Delete the specified blob and all of its snapshots. |
Alternatively, if snapshot is non-empty, the specified snapshot of Blob is deleted, and DeleteAction is ignored.
If the current Azure Storage account, specified by account, has a delete retention policy enabled for the Blob service, then this method will only soft-delete blobs (and snapshots). Soft-deleted blobs and snapshots can be listed by enabling the IncludeSoftDeleted configuration setting before calling list_blobs, and can be undeleted at any point before their retention period expires by calling undelete_blob.
If the specified blob has an active lease, its lease Id must be specified using lease_id, or the request will fail.