Azure / Azure/Azurite

Behavior difference: uploading a blob which has an active lease

Open
#2,637 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

**Error description:**

If I try to upload a blob that has an active lease on it, the behavior of Azurite differs from the real blob storage.
Azurite returns a `BlobAlreadyExists` while the real storage returns `LeaseIdMissing`.
Azurite returns `LeaseIdMissing` only if `overwrite=True`.
The behavior difference exists in the latest supported API version (2025-11-05) and in the latest API.

**Reproduction (Python SDK v12.28.0):**

Azurite no overwrite:
```python
blob_service= BlobServiceClient.from_connection_string("UseDevelopmentStorage=true", api_version="2025-11-05")
blob_client = blob_service.get_blob_client("foo", "bar")
blob_client.upload_blob(b"")
blob_client.acquire_lease(90)
blob_client.upload_blob(b"foobar") # --> raises ResourceExistsError
```

Azurite overwrite:
```python
blob_service= BlobServiceClient.from_connection_string("UseDevelopmentStorage=true", api_version="2025-11-05")
blob_client = blob_service.get_blob_client("foo", "bar")
blob_client.upload_blob(b"", overwrite=True)
blob_client.acquire_lease(90)
blob_client.upload_blob(b"foobar") # --> raises LeaseIdMissing
```

Real storage no overwrite:
```python
blob_service= BlobServiceClient.from_connection_string("", api_version="2025-11-05")
blob_client = blob_service.get_blob_client("foo", "bar")
blob_client.upload_blob(b"")
blob_client.acquire_lease(90)
blob_client.upload_blob(b"foobar") # --> raises LeaseIdMissing
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Trace Azurite's blob upload handling and lease checks, using the supplied Python SDK reproduction with API version 2025-11-05 as the starting test. Done means a non-overwrite upload against an actively leased blob returns LeaseIdMissing, while the documented overwrite behavior remains unchanged; add or update regression coverage for both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.