# 409 冲突：Blob 'container/blob.txt' 当前有租约。请求中未指定租约 ID。

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

## 根因

Blob 具有活动租约（例如，无限期或有限期），必须在删除请求中释放或指定租约 ID，但操作尝试删除时未提供租约 ID。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| azure_cli | active | — | — |
| storage_sdk | active | — | — |
| blob_service | active | — | — |

## 解决方案

1. ```
   Break the lease first using Azure CLI: `az storage blob lease break --account-name mystorageaccount --container-name container --name blob.txt --lease-break-period 30`. Then delete: `az storage blob delete --account-name mystorageaccount --container-name container --name blob.txt`
   ```
2. ```
   In code (Python SDK), get the lease ID and delete: `from azure.storage.blob import BlobClient; blob = BlobClient.from_connection_string(conn_str, container_name="container", blob_name="blob.txt"); lease = blob.acquire_lease(); blob.delete_blob(lease=lease)`
   ```

## 无效尝试

- **** — If the lease is infinite (never expires), waiting won't help; you must break it explicitly. (80% 失败率)
- **** — The portal also requires lease ID for leased blobs; it will show the same error. (90% 失败率)
