# 409 冲突：指定的租约 ID 与 Blob 快照的租约 ID 不匹配

- **ID:** `cloud/azure-blob-storage-lease-conflict-on-snapshot`
- **领域:** cloud
- **类别:** protocol_error
- **错误码:** `409 Conflict`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

当尝试删除或修改具有活动租约的 Blob 时，如果未正确提供租约 ID，操作将失败，尤其是当 Blob 具有继承或需要单独租约管理的快照时。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Azure Storage REST API: 2019-07-07 | active | — | — |
| Azure SDK for .NET: >= 12.10.0 | active | — | — |
| Azure Portal: latest | active | — | — |

## 解决方案

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>'.
   ```
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>'.
   ```

## 无效尝试

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