# 409 Conflict: The lease ID specified did not match the lease ID of the blob snapshot

- **ID:** `cloud/azure-blob-storage-lease-conflict-on-snapshot`
- **Domain:** cloud
- **Category:** protocol_error
- **Error Code:** `409 Conflict`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

When attempting to delete or modify a blob that has an active lease, the operation fails if the lease ID is not provided correctly, especially when the blob has snapshots that inherit or require separate lease management.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Azure Storage REST API: 2019-07-07 | active | — | — |
| Azure SDK for .NET: >= 12.10.0 | active | — | — |
| Azure Portal: latest | active | — | — |

## Workarounds

1. **Retrieve the current lease ID by calling 'Get Blob Properties' and then use that lease ID in the delete request. Example in Azure CLI: 'az storage blob lease break --account-name <storage-account> --container-name <container> --blob-name <blob> --lease-duration -1' then delete with 'az storage blob delete --account-name <storage-account> --container-name <container> --name <blob> --lease-id <lease-id>'.** (90% success)
   ```
   Retrieve the current lease ID by calling 'Get Blob Properties' and then use that lease ID in the delete request. Example in Azure CLI: 'az storage blob lease break --account-name <storage-account> --container-name <container> --blob-name <blob> --lease-duration -1' then delete with 'az storage blob delete --account-name <storage-account> --container-name <container> --name <blob> --lease-id <lease-id>'.
   ```
2. **If the blob has snapshots, delete the snapshots first with the same lease ID, then delete the base blob. Use 'az storage blob delete --account-name <storage-account> --container-name <container> --name <blob> --delete-snapshots include --lease-id <lease-id>'.** (85% success)
   ```
   If the blob has snapshots, delete the snapshots first with the same lease ID, then delete the base blob. Use 'az storage blob delete --account-name <storage-account> --container-name <container> --name <blob> --delete-snapshots include --lease-id <lease-id>'.
   ```

## Dead Ends

- **** — If the lease is still active, the delete operation fails with a 409 error; the lease must be explicitly released or renewed. (70% fail)
- **** — The Azure Storage API requires an exact lease ID match; wildcards are not supported. (90% fail)
- **** — Snapshots may have their own leases or inherit the base blob's lease; deleting them without the correct lease ID can also fail. (60% fail)
